<template>
  <div>

    <div class="scenes-left">
      <el-row v-show="button_show">
        <el-button icon="el-icon-circle-plus" type="primary" size="small" @click="handleAdd">添加场景</el-button>
        <el-button icon="el-icon-delete" @click="deleteScenes" size="small" >删除场景</el-button>
      </el-row>

  <el-menu
    :default-active="maxIndex"
    @open="handleOpen"
    @close="handleClose"
    style="width: 240px;"
  >
    <el-submenu index="0">
      <template slot="title">
        <span>暴露场景</span>
      </template>

      <el-scrollbar
        wrapClass="scrollbar-wrap"
        :style="{height: scrollHeight}"
        ref="scrollbarContainer">
      <el-menu-item :index="(index +'')" v-for="(item,index) in this.scenes" :key="index" @click="showScenes(item,index)"><span>{{item.lifeCycle}}：{{item.title}}</span>
      </el-menu-item>
      </el-scrollbar>

    </el-submenu>
  </el-menu>

    </div>

   <!--新增-->
    <div class="emission-content" >

      <el-tag class="current-tag"><b>当前物质：</b>{{this.form.wzmc}}</el-tag>

      <div v-show="scene_show">

      <el-form ref="form" :model="form"  label-width="540px">
        <br>
        <el-card class="">
        <el-form-item label="如需添加场景，请先点击添加场景，再填写信息后点击“保存”。"  style="width: 100%; " >
        </el-form-item>


        </el-card>
      </el-form>

      <div v-show="input_show">
        <el-form ref="form" :model="form" label-width="540px" >

          <div v-show="industrial_disabled"  >
            <el-card class="box-card">

              <el-form-item label="暴露场景短标题：" style=" width: 100%;" prop="title">
                <el-col :span="8">
                  <el-input v-model="form.title" style="width: 100%;" auto-complete="off" :disabled="title_disabled" ></el-input>
                </el-col>
                <el-col :span="2">
                    <el-button type="primary" icon="el-icon-edit" circle @click="()=>{title_disabled = !title_disabled}"></el-button>
                </el-col>
              </el-form-item>

              <el-form-item label="化学物质的年生产使用量：" style=" width: 100%; background-color: white" prop="qchemical">
                <el-col :span="8">
                  <el-input v-model="form.qchemical" style="width: 100%; " auto-complete="off" >
                    <template slot="append">kg/y</template>
                  </el-input>
                </el-col>

              </el-form-item>

              <el-form-item label="年排放时间：" style=" width: 100%; background-color: white" prop="temission">
                <el-col :span="8">
                  <el-input v-model="form.temission" style="width: 100%;" auto-complete="off" :disabled="temission_disabled">
                    <template slot="append">d/y</template>
                  </el-input>
                </el-col>
                <el-col :span="2">
                  <el-tooltip class="item" effect="dark" :content="temissionTip" placement="right">
                    <el-button type="primary" icon="el-icon-edit" circle @click="changeTemission"></el-button>
                  </el-tooltip>
                </el-col>
              </el-form-item>

              <el-form-item label="主要排放源占比：" style=" width: 100%; background-color: white" prop="main">
                <el-col :span="8" >
                  <el-input v-model="form.main" style="width: 100%;" auto-complete="off" :disabled="main_disabled">
                  </el-input>
                </el-col>
                <el-col :span="2">
                  <el-tooltip class="item" effect="dark" :content="mainTip" placement="right">
                    <el-button type="primary" icon="el-icon-edit" circle @click="changeMain"></el-button>
                  </el-tooltip>
                </el-col>
              </el-form-item>

              <el-form-item label="排放模式：" style=" width: 100%; background-color: white" prop="emissionPattern">
                <el-col :span="8">
                  <el-radio v-model="form.emissionPattern" label="1" @change="changeStandardstp">连续排放</el-radio>
                  <el-radio v-model="form.emissionPattern" label="2" @change="changeStandardstp">间歇排放</el-radio>
                </el-col>
              </el-form-item>
            </el-card>

            <el-card class="box-card">
              <div style="padding-top: 0; margin-bottom: 20px;">
              <div class="clearfix" style="height: 60px; background-color: #8cc5ff;" >
                <div style="display:inline-block; text-align: center; ">
                <h3>排放系数</h3>
                </div>
              </div>
              </div>
              <el-form-item label="排放系数-废水：" style="width: 100%; background-color: 	white"  prop="water">
                <el-col :span="8" >
                  <el-input v-model="form.water" style="width: 100%; " auto-complete="off"></el-input>
                </el-col>
              </el-form-item>

              <el-form-item label="排放系数-废气：" style=" width: 100%; background-color: 	white" prop="air">
                <el-col :span="8">
                  <el-input v-model="form.air" style="width: 100%;" auto-complete="off"></el-input>
                </el-col>
              </el-form-item>

              <el-form-item label="排放系数-土壤：" style=" width: 100%; background-color: 	white" prop="sludge">
                <el-col :span="8">
                  <el-input v-model="form.sludge" style="width: 100%;" auto-complete="off"></el-input>
                </el-col>
              </el-form-item>
            </el-card>


            <el-card class="box-card">

                <div style="padding-top: 0; margin-bottom: 20px;">
                  <div class="clearfix" style="height: 60px; background-color: #8cc5ff;" >
                    <div style="display:inline-block; text-align: center; ">
                      <h3 style="color: black">污染控制</h3>
                    </div>
                  </div>

              </div>
              <el-form-item label="企业内部减排效率-大气：" style=" width: 100%; background-color: white" prop="abatementAir">
                <el-col :span="8">
                  <el-input v-model="form.abatementAir" style="width: 100%;" auto-complete="off"></el-input>
                </el-col>
              </el-form-item>


              <el-form-item label="企业内部减排效率-土壤：" style=" width: 100%; background-color: white" prop="abatementSludge">
                <el-col :span="8">
                  <el-input v-model="form.abatementSludge" style="width: 100%;" auto-complete="off"></el-input>
                </el-col>
              </el-form-item>

              <el-form-item label="企业自有STP处理："  style=" width: 100%; background-color: white" prop="stponsite">
                <el-col :span="8">
                  <el-select style="width: 100%;" v-model="form.stponsite" placeholder="请选择" @change="stponsiteShow">
                    <el-option
                      v-for="item in options2"
                      :key="item.label"
                      :label="item.label"
                      :value="item.label">
                    </el-option>
                  </el-select>
                </el-col>
              </el-form-item>

              <el-row v-show="stponsite_disabled">
                <el-form-item label="STP地表水排放系数：" style=" width: 100%; background-color: white" prop="stponsiteWater" ><el-col :span="8">
                  <el-input v-model="form.stponsiteWater" style="width: 100%;" auto-complete="off" @change="setAbatementWater" :disabled="!(isStponsite)"></el-input>   </el-col>
                </el-form-item>


                <el-form-item label="STP大气排放系数：" style=" width: 100%; background-color: white" prop="stponsiteAir">
                  <el-col :span="8">
                    <el-input v-model="form.stponsiteAir" style="width: 100%;" auto-complete="off" :disabled="!(isStponsite)"></el-input>
                  </el-col>
                </el-form-item>

                <el-form-item label="STP污泥排放系数：" style=" width: 100%; background-color: white" prop="stponsiteSludge">
                  <el-col :span="8">
                    <el-input v-model="form.stponsiteSludge" style="width: 100%;" auto-complete="off" :disabled="!(isStponsite)"></el-input>
                  </el-col>
                </el-form-item>

                <el-form-item label="降解去除：" style=" width: 100%; background-color: white" prop="stponsiteDegrade">
                  <el-col :span="8">
                    <el-input v-model="form.stponsiteDegrade" style="width: 100%;" auto-complete="off" :disabled="!(isStponsite)"></el-input>
                  </el-col>
                </el-form-item>
              </el-row>

              <el-form-item label="企业内部减排效率-废水：" style=" width: 100%; background-color: white" prop="abatementWater">
                <el-col :span="8">
                  <el-input v-model="form.abatementWater" style="width: 100%;" auto-complete="off" :disabled="abatementWater_disabled"></el-input>
                </el-col>
              </el-form-item>
            </el-card>

            <el-card class="box-card">
              <div style="padding-top: 0; margin-bottom: 20px;">
                <div class="clearfix" style="height: 60px; background-color: #8cc5ff;" >
                  <div style="display:inline-block; text-align: center; ">
                    <h3>废水去向</h3>
                  </div>
                </div>
              </div>
              <el-form-item label="废水去向：" style=" width: 100%; " prop="waterTo">
                <el-col :span="8" >
                  <el-radio v-model="form.waterTo" label="1" @change="setOther">直排地表水</el-radio>
                  <el-radio v-model="form.waterTo" label="2" @change="setOther">进入集中式STP处理</el-radio>
                </el-col>
              </el-form-item>

              <el-row v-show="isWaterto">
                <el-form-item label="公共STP排放评估方法：" style=" width: 100%; " prop="publicStp">
                  <el-col :span="8"  >
                    <el-radio v-model="form.publicStp" label="1" @change="changeStp">标准STP</el-radio>
                    <el-radio v-model="form.publicStp" label="2" @change="changeStp">自行输入</el-radio>
                  </el-col>
                </el-form-item>
                <!--</el-row>

                <el-row v-show="stp_disabled">-->
                <el-form-item label="STP地表水排放系数：" style=" width: 100%; " prop="stpWater"><el-col :span="8">
                  <el-input v-model="form.stpWater" style="width: 100%;" auto-complete="off" :disabled="stp_disabled"></el-input>   </el-col>
                </el-form-item>

                <el-form-item label="STP大气排放系数：" style=" width: 100%;" prop="stpAir">
                  <el-col :span="8">
                    <el-input v-model="form.stpAir" style="width: 100%;" auto-complete="off" :disabled="stp_disabled"></el-input>
                  </el-col>
                </el-form-item>

                <el-form-item label="STP污泥排放系数：" style=" width: 100%; " prop="stpSludge">
                  <el-col :span="8">
                    <el-input v-model="form.stpSludge" style="width: 100%;" auto-complete="off" :disabled="stp_disabled"></el-input>
                  </el-col>
                </el-form-item>

                <el-form-item label="降解去除：" style=" width: 100%;" prop="stpDegrade">
                  <el-col :span="8">
                    <el-input v-model="form.stpDegrade" style="width: 100%;" auto-complete="off" :disabled="stp_disabled"></el-input>
                  </el-col>
                </el-form-item>


                <el-form-item label="污泥是否农用：" style=" width: 100%; " prop="appLsludge">
                  <el-col :span="8">
                    <el-radio v-model="form.appLsludge" label="1" @change="changeSludge">是</el-radio>
                    <el-radio v-model="form.appLsludge" label="2" @change="changeSludge">否</el-radio>
                  </el-col>
                </el-form-item>
              </el-row>
            </el-card>

            <el-card class="box-card">
              <div style="padding-top: 0; margin-bottom: 20px;">
                <div class="clearfix" style="height: 60px; background-color: #8cc5ff;" >
                  <div style="display:inline-block; text-align: center; ">
                    <h3>周边环境</h3>
                  </div>
                </div>
              </div>
              <el-form-item label="废水流量：" style=" width: 100%; background-color: white" prop="stpEffluent">
                <el-col :span="8">
                  <el-input v-model="form.stpEffluent" style="width: 100%;" auto-complete="off" :disabled="effluent_disabled">
                    <template slot="append">m<sup>3</sup>/d</template>
                  </el-input>
                </el-col>
                <el-col :span="2">
                  <el-tooltip class="item" effect="dark" :content="effluentTip" placement="right">
                    <el-button type="primary" icon="el-icon-edit" circle @click="changeEffluent"></el-button>
                  </el-tooltip>
                </el-col>
              </el-form-item>

              <el-form-item label="受纳水体流量：" style=" width: 100%; background-color: 	white" prop="flow">
                <el-col :span="8">
                  <el-input v-model="form.flow" style="width: 100%;" auto-complete="off" :disabled="flow_disabled">
                    <template slot="append">m<sup>3</sup>/d</template>
                  </el-input>
                </el-col>
                <el-col :span="2">
                  <el-tooltip class="item" effect="dark" :content="flowTip" placement="right">
                    <el-button type="primary" icon="el-icon-edit" circle @click="changeFlow"></el-button>
                  </el-tooltip>
                </el-col>
              </el-form-item>
            </el-card>
          </div>


          <div v-show="consume_disabled">
            <el-card class="box-card">
              <el-form-item label="暴露场景短标题：" style=" width: 100%;" prop="title">
                <el-col :span="8">
                  <el-input v-model="form.title" style="width: 100%;" auto-complete="off" :disabled="title_disabled" ></el-input>
                </el-col>
                <el-col :span="2">
                  <el-button type="primary" icon="el-icon-edit" circle @click="()=>{title_disabled = !title_disabled}"></el-button>
                </el-col>
              </el-form-item>

              <el-form-item label="化学物质的年生产使用量：" style=" width: 100%; background-color: white" prop="qchemical">
                <el-col :span="8">
                  <el-input v-model="form.qchemical" style="width: 100%; " auto-complete="off" >
                    <template slot="append">kg/y</template>
                  </el-input>
                </el-col>
              </el-form-item>

              <el-form-item label="年排放时间：" style=" width: 100%; " prop="temission">
                <el-col :span="8">
                  <el-input v-model="form.temission" style="width: 100%;" auto-complete="off" :disabled="temission_disabled">
                    <template slot="append">d/y</template>
                  </el-input>
                </el-col>
                <el-col :span="2">
                  <el-tooltip class="item" effect="dark" :content="temissionTip" placement="right">
                    <el-button type="primary" icon="el-icon-edit" circle @click="changeTemission"></el-button>
                  </el-tooltip>
                </el-col>
              </el-form-item>

              <el-form-item label="废水直排比例：" style=" width: 100%; " prop="fdirectwater">
                <el-col :span="8">
                  <el-input v-model="form.fdirectwater" style="width: 100%;" auto-complete="off" :disabled="fdirectwater_disabled">
                  </el-input>
                </el-col>
                <el-col :span="2">
                  <el-tooltip class="item" effect="dark" :content="fdirectwaterTip" placement="right">
                    <el-button type="primary" icon="el-icon-edit" circle @click="changeFdirectwater"></el-button>
                  </el-tooltip>
                </el-col>
              </el-form-item>

              <el-form-item label="区域使用量占全国的比例：" style=" width: 100%; background-color: white" prop="freg">
                <el-col :span="8">
                  <el-input v-model="form.freg" style="width: 100%;" auto-complete="off" :disabled="freg_disabled">
                  </el-input>
                </el-col>
                <el-col :span="2">
                  <el-tooltip class="item" effect="dark" :content="fregTip" placement="right">
                    <el-button type="primary" icon="el-icon-edit" circle @click="changeFreg"></el-button>
                  </el-tooltip>
                </el-col>
              </el-form-item>

              <el-form-item label="STP服务区域用量占区域用量的比例：" style=" width: 100%; background-color: white" prop="flocal">
                <el-col :span="8">
                  <el-input v-model="form.flocal" style="width: 100%;" auto-complete="off" :disabled="flocal_disabled">
                  </el-input>
                </el-col>
                <el-col :span="2">
                  <el-tooltip class="item" effect="dark" :content="flocalTip" placement="right">
                    <el-button type="primary" icon="el-icon-edit" circle @click="changeFlocal"></el-button>
                  </el-tooltip>
                </el-col>
              </el-form-item>

              <el-form-item label="空间和时间的变异系数：" style=" width: 100%; background-color: white" prop="fvariability">
                <el-col :span="8">
                  <el-input v-model="form.fvariability" style="width: 100%;" auto-complete="off" :disabled="fvariability_disabled">
                  </el-input>
                </el-col>
                <el-col :span="2">
                  <el-tooltip class="item" effect="dark" :content="fvariabilityTip" placement="right">
                    <el-button type="primary" icon="el-icon-edit" circle @click="changeFvariability"></el-button>
                  </el-tooltip>
                </el-col>
              </el-form-item>
            </el-card>

            <el-card class="box-card">
              <div style="padding-top: 0; margin-bottom: 20px;">
                <div class="clearfix" style="height: 60px; background-color: #8cc5ff;" >
                  <div style="display:inline-block; text-align: center; ">
                    <h3>排放系数</h3>
                  </div>
                </div>
              </div>
              <el-form-item label="排放系数-废水：" style=" width: 100%; " prop="water">
                <el-col :span="8">
                  <el-input v-model="form.water" style="width: 100%;" auto-complete="off"></el-input>
                </el-col>
              </el-form-item>

              <el-form-item label="排放系数-废气：" style=" width: 100%; " prop="air">
                <el-col :span="8">
                  <el-input v-model="form.air" style="width: 100%;" auto-complete="off"></el-input>
                </el-col>
              </el-form-item>

              <el-form-item label="排放系数-土壤：" style=" width: 100%; " prop="sludge">
                <el-col :span="8">
                  <el-input v-model="form.sludge" style="width: 100%;" auto-complete="off"></el-input>
                </el-col>
              </el-form-item>
            </el-card>

          </div>

          <div v-show="waste_disabled">
            <el-card class="box-card">
              <el-form-item label="暴露场景短标题：" style=" width: 100%;" prop="title">
                <el-col :span="8">
                  <el-input v-model="form.title" style="width: 100%;" auto-complete="off" :disabled="title_disabled" ></el-input>
                </el-col>
                <el-col :span="2">
                  <el-button type="primary" icon="el-icon-edit" circle @click="()=>{title_disabled = !title_disabled}"></el-button>
                </el-col>
              </el-form-item>

              <el-form-item label="化学物质的年生产使用量：" style=" width: 100%; background-color: white" prop="qchemical">
                <el-col :span="8">
                  <el-input v-model="form.qchemical" style="width: 100%; " auto-complete="off" >
                    <template slot="append">kg/y</template>
                  </el-input>
                </el-col>

              </el-form-item>

              <el-form-item label="年排放时间：" style=" width: 100%; background-color: white" prop="temission">
                <el-col :span="8">
                  <el-input v-model="form.temission" style="width: 100%;" auto-complete="off" :disabled="temission_disabled">
                    <template slot="append">d/y</template>
                  </el-input>
                </el-col>
                <el-col :span="2">
                  <el-tooltip class="item" effect="dark" :content="temissionTip" placement="right">
                    <el-button type="primary" icon="el-icon-edit" circle @click="changeTemission"></el-button>
                  </el-tooltip>
                </el-col>
              </el-form-item>

              <el-form-item label="进入固体废物的化学物质的比例：" style=" width: 100%; background-color: white" prop="waste">
                <el-col :span="8">
                  <el-input v-model="form.waste" style="width: 100%;" auto-complete="off">
                  </el-input>
                </el-col>
              </el-form-item>

              <el-form-item label="分散性因子：" style=" width: 100%; background-color: white" prop="fmain">
                <el-col :span="8">
                  <el-input v-model="form.fmain" style="width: 100%;" auto-complete="off" :disabled="fmain_disabled">
                  </el-input>
                </el-col>
                <el-col :span="2">
                  <el-tooltip class="item" effect="dark" :content="fmainTip" placement="right">
                    <el-button type="primary" icon="el-icon-edit" circle @click="changeFmain"></el-button>
                  </el-tooltip>
                </el-col>
              </el-form-item>

              <el-form-item label="排放模式：" style=" width: 100%; background-color: white" prop="emissionPattern">
                <el-col :span="8">
                  <el-radio v-model="form.emissionPattern" label="1" @change="changeStandardstp">连续排放</el-radio>
                  <el-radio v-model="form.emissionPattern" label="2" @change="changeStandardstp">间歇排放</el-radio>
                </el-col>
              </el-form-item>
            </el-card>

            <el-card class="box-card">
              <div style="padding-top: 0; margin-bottom: 20px;">
                <div class="clearfix" style="height: 60px; background-color: #8cc5ff;" >
                  <div style="display:inline-block; text-align: center; ">
                    <h3>排放系数</h3>
                  </div>
                </div>
              </div>
              <el-form-item label="排放系数-废水：" style=" width: 100%; " prop="water">
                <el-col :span="8">
                  <el-input v-model="form.water" style="width: 100%;" auto-complete="off"></el-input>
                </el-col>
              </el-form-item>

              <el-form-item label="排放系数-废气：" style=" width: 100%; " prop="air">
                <el-col :span="8">
                  <el-input v-model="form.air" style="width: 100%;" auto-complete="off"></el-input>
                </el-col>
              </el-form-item>

              <el-form-item label="排放系数-土壤：" style=" width: 100%; " prop="sludge">
                <el-col :span="8">
                  <el-input v-model="form.sludge" style="width: 100%;" auto-complete="off"></el-input>
                </el-col>
              </el-form-item>
            </el-card>


            <el-card class="box-card">
              <div style="padding-top: 0; margin-bottom: 20px;">
                <div class="clearfix" style="height: 60px; background-color: #8cc5ff;" >
                  <div style="display:inline-block; text-align: center; ">
                    <h3>污染控制</h3>
                  </div>
                </div>
              </div>
              <el-form-item label="企业内部减排效率-大气：" style=" width: 100%; background-color: white" prop="abatementAir">
                <el-col :span="8">
                  <el-input v-model="form.abatementAir" style="width: 100%;" auto-complete="off"></el-input>
                </el-col>
              </el-form-item>

              <el-form-item label="企业内部减排效率-土壤：" style=" width: 100%; background-color: white" prop="abatementSludge">
                <el-col :span="8">
                  <el-input v-model="form.abatementSludge" style="width: 100%;" auto-complete="off"></el-input>
                </el-col>
              </el-form-item>

              <el-form-item label="企业自有STP处理："  style=" width: 100%; background-color: white" prop="stponsite">
                <el-col :span="8">
                  <el-select style="width: 100%;" v-model="form.stponsite" placeholder="请选择" @change="stponsiteShow">
                    <el-option
                      v-for="item in options2"
                      :key="item.label"
                      :label="item.label"
                      :value="item.label">
                    </el-option>
                  </el-select>
                </el-col>
              </el-form-item>

              <el-row v-show="stponsite_disabled">

                <el-form-item label="企业自有STP废水排放系数：" style=" width: 100%; background-color: white" prop="stponsiteWater" ><el-col :span="8">
                  <el-input v-model="form.stponsiteWater" style="width: 100%;" auto-complete="off" @change="setAbatementWater" :disabled="!(isStponsite)"></el-input>   </el-col>
                </el-form-item>


                <el-form-item label="企业自有STP废气排放系数：" style=" width: 100%; background-color: white" prop="stponsiteAir">
                  <el-col :span="8">
                    <el-input v-model="form.stponsiteAir" style="width: 100%;" auto-complete="off" :disabled="!(isStponsite)"></el-input>
                  </el-col>
                </el-form-item>

                <el-form-item label="企业自有STP固废排放系数：" style=" width: 100%; background-color: white" prop="stponsiteSludge">
                  <el-col :span="8">
                    <el-input v-model="form.stponsiteSludge" style="width: 100%;" auto-complete="off" :disabled="!(isStponsite)"></el-input>
                  </el-col>
                </el-form-item>

                <el-form-item label="降解去除：" style=" width: 100%; background-color: white" prop="stponsiteDegrade">
                  <el-col :span="8">
                    <el-input v-model="form.stponsiteDegrade" style="width: 100%;" auto-complete="off" :disabled="!(isStponsite)"></el-input>
                  </el-col>
                </el-form-item>
              </el-row>

              <el-form-item label="企业内部减排效率-废水：" style=" width: 100%; background-color: white" prop="abatementWater" >
                <el-col :span="8">
                  <el-input v-model="form.abatementWater" style="width: 100%;" auto-complete="off" :disabled="abatementWater_disabled"></el-input>
                </el-col>
              </el-form-item>
            </el-card>

            <el-card class="box-card">
              <div style="padding-top: 0; margin-bottom: 20px;">
                <div class="clearfix" style="height: 60px; background-color: #8cc5ff;" >
                  <div style="display:inline-block; text-align: center; ">
                    <h3>废水去向</h3>
                  </div>
                </div>
              </div>
              <el-form-item label="废水去向：" style=" width: 100%; " prop="waterTo">
                <el-col :span="8" >
                  <el-radio v-model="form.waterTo" label="1" @change="setOther">直排地表水</el-radio>
                  <el-radio v-model="form.waterTo" label="2" @change="setOther">进入集中式STP处理</el-radio>
                </el-col>
              </el-form-item>

              <el-row v-show="isWaterto">
                <el-form-item label="公共STP排放评估方法：" style=" width: 100%; " prop="publicStp">
                  <el-col :span="8"  >
                    <el-radio v-model="form.publicStp" label="1" @change="changeStp">标准STP</el-radio>
                    <el-radio v-model="form.publicStp" label="2" @change="changeStp">自行输入</el-radio>
                  </el-col>
                </el-form-item>
                <!--</el-row>

                <el-row v-show="stp_disabled">-->
                <el-form-item label="企业自有STP废水排放系数：" style=" width: 100%; " prop="stpWater"><el-col :span="8">
                  <el-input v-model="form.stpWater" style="width: 100%;" auto-complete="off" :disabled="stp_disabled"></el-input>   </el-col>
                </el-form-item>

                <el-form-item label="企业自有STP废气排放系数：" style=" width: 100%; " prop="stpAir">
                  <el-col :span="8">
                    <el-input v-model="form.stpAir" style="width: 100%;" auto-complete="off" :disabled="stp_disabled"></el-input>
                  </el-col>
                </el-form-item>

                <el-form-item label="企业自有STP固废排放系数：" style=" width: 100%; " prop="stpSludge">
                  <el-col :span="8">
                    <el-input v-model="form.stpSludge" style="width: 100%;" auto-complete="off" :disabled="stp_disabled"></el-input>
                  </el-col>
                </el-form-item>

                <el-form-item label="降解去除：" style=" width: 100%; " prop="stpDegrade">
                  <el-col :span="8">
                    <el-input v-model="form.stpDegrade" style="width: 100%;" auto-complete="off" :disabled="stp_disabled"></el-input>
                  </el-col>
                </el-form-item>


                <el-form-item label="污泥是否农用：" style=" width: 100%; " prop="appLsludge" >
                  <el-col :span="8">
                    <el-radio v-model="form.appLsludge" label="1" @change="changeSludge">是</el-radio>
                    <el-radio v-model="form.appLsludge" label="2" @change="changeSludge">否</el-radio>
                  </el-col>
                </el-form-item>
              </el-row>
            </el-card>

            <el-card class="box-card">
              <div style="padding-top: 0; margin-bottom: 20px;">
                <div class="clearfix" style="height: 60px; background-color: #8cc5ff;" >
                  <div style="display:inline-block; text-align: center; ">
                    <h3 style="color: black">周边环境</h3>
                  </div>
                </div>
              </div>
              <el-form-item label="废水流量：" style=" width: 100%; background-color: white" prop="stpEffluent">
                <el-col :span="8">
                  <el-input v-model="form.stpEffluent" style="width: 100%;" auto-complete="off" :disabled="effluent_disabled">
                    <template slot="append">m<sup>3</sup>/d</template>
                  </el-input>
                </el-col>
                <el-col :span="2">
                  <el-tooltip class="item" effect="dark" :content="effluentTip" placement="right">
                    <el-button type="primary" icon="el-icon-edit" circle @click="changeEffluent"></el-button>
                  </el-tooltip>
                </el-col>
              </el-form-item>

              <el-form-item label="受纳水体流量：" style=" width: 100%; background-color: white" prop="flow">
                <el-col :span="8">
                  <el-input v-model="form.flow" style="width: 100%;" auto-complete="off" :disabled="flow_disabled">
                    <template slot="append">m<sup>3</sup>/d</template>
                  </el-input>
                </el-col>
                <el-col :span="2">
                  <el-tooltip class="item" effect="dark" :content="flowTip" placement="right">
                    <el-button type="primary" icon="el-icon-edit" circle @click="changeFlow"></el-button>
                  </el-tooltip>
                </el-col>
              </el-form-item>
            </el-card>
          </div>
        </el-form>
  <br>
  <div v-show="isEmission" >
    <el-button type="danger" icon="el-icon-edit-outline" @click="compute" >计算</el-button>
    <el-button type="primary" icon="el-icon-success" @click="updateScenes" >保存</el-button>
  </div>
  <br>
  <el-card class="box-card">
  <div style="padding-top: 0; margin-bottom: 20px;">
    <div class="clearfix" style="height: 60px; background-color: #8cc5ff;" >
      <div style="display:inline-block; text-align: center; ">
        <h3>排放率</h3>
      </div>
    </div>
  </div>
      <div >
        <el-form ref="form" :model="form" label-width="540px">

          <el-form-item label="水-直排（Edirectwater.L）：" style=" width: 100%;" prop="elocalDirectwater">
            <el-col :span="8">
              <el-input v-model="form.elocalDirectwater" style="width: 100%;" auto-complete="off" :disabled="elocalDirectwater_disabled">
                <template slot="append">kg/d</template>
              </el-input>
            </el-col>
            <el-col :span="2">
              <!--            <el-tooltip class="item" effect="dark" :content="elocalDirectwaterTip" placement="right">-->
              <el-button type="primary" icon="el-icon-edit" circle @click="changeElocaldirectwater"></el-button>
              <!--            </el-tooltip>-->
            </el-col>
          </el-form-item>

          <el-form-item label="水-排入集中式STP（Ewater.L）：" style=" width: 100%;" prop="elocalWater">
            <el-col :span="8">
              <el-input v-model="form.elocalWater" style="width: 100%;" auto-complete="off" :disabled="elocalWater_disabled">
                <template slot="append">kg/d</template>
              </el-input>
            </el-col>
            <el-col :span="2">
              <!--            <el-tooltip class="item" effect="dark" :content="elocalWaterTip" placement="right">-->
              <el-button type="primary" icon="el-icon-edit" circle @click="changeElocalwater"></el-button>
              <!--            </el-tooltip>-->
            </el-col>
          </el-form-item>

          <el-form-item label="水-集中式STP间接排放（Estp.water.L）：" style=" width: 100%;" prop="elocalstpWater">
            <el-col :span="8">
              <el-input v-model="form.elocalstpWater" style="width: 100%;" auto-complete="off" :disabled="elocalstpWater_disabeld">
                <template slot="append">kg/d</template>
              </el-input>
            </el-col>
            <el-col :span="2">
              <!--            <el-tooltip class="item" effect="dark" :content="elocalstpWaterTip" placement="right">-->
              <el-button type="primary" icon="el-icon-edit" circle @click="changeElocalstpwater"></el-button>
              <!--            </el-tooltip>-->
            </el-col>
          </el-form-item>


          <el-form-item label="大气-直排（Eair.L）：" style=" width: 100%;" prop="elocalAir">
            <el-col :span="8">
              <el-input v-model="form.elocalAir" style="width: 100%;" auto-complete="off" :disabled="elocalAir_disabled">
                <template slot="append">kg/d</template>
              </el-input>
            </el-col>
            <el-col :span="2">
              <!--            <el-tooltip class="item" effect="dark" :content="elocalAirTip" placement="right">-->
              <el-button type="primary" icon="el-icon-edit" circle @click="changeElocalair"></el-button>
              <!--            </el-tooltip>-->
            </el-col>
          </el-form-item>

          <el-form-item label="大气-集中式STP间接排放（Estp.air.L）：" style=" width: 100%;" prop="elocalstpAir">
            <el-col :span="8">
              <el-input v-model="form.elocalstpAir" style="width: 100%;" auto-complete="off" :disabled="elocalstpAir_disabled">
                <template slot="append">kg/d</template>
              </el-input>
            </el-col>
            <el-col :span="2">
              <!--            <el-tooltip class="item" effect="dark" :content="elocalstpAirTip" placement="right">-->
              <el-button type="primary" icon="el-icon-edit" circle @click="changeElocalstpair"></el-button>
              <!--            </el-tooltip>-->
            </el-col>
          </el-form-item>

          <el-form-item label="土壤-直排（Esoil.L）：" style=" width: 100%;" prop="elocalSoil">
            <el-col :span="8">
              <el-input v-model="form.elocalSoil" style="width: 100%;" auto-complete="off" :disabled="elocalSoil_disabled">
                <template slot="append">kg/d</template>
              </el-input>
            </el-col>
            <el-col :span="2">
              <!--            <el-tooltip class="item" effect="dark" :content="elocalSoilTip" placement="right">-->
              <el-button type="primary" icon="el-icon-edit" circle @click="changeElocalsoil"></el-button>
              <!--            </el-tooltip>-->
            </el-col>
          </el-form-item>

          <el-form-item label="土壤-集中式STP间接排放（Estp.soil.L）：" style=" width: 100%;" prop="elocalstpSoil">
            <el-col :span="8">
              <el-input v-model="form.elocalstpSoil" style="width: 100%;" auto-complete="off" :disabled="elocalstpSoil_disabled">
                <template slot="append">kg/d</template>
              </el-input>
            </el-col>
            <el-col :span="2">
              <!--            <el-tooltip class="item" effect="dark" :content="elocalSoilTip" placement="right">-->
              <el-button type="primary" icon="el-icon-edit" circle @click="changeElocalstpsoil"></el-button>
              <!--            </el-tooltip>-->
            </el-col>
          </el-form-item>
          <br><br><br><br><br><br>

        </el-form>
      </div>
  </el-card>

        </div>
  </div>

      <div v-show="results_show">

        <div v-if="this.userName !== 'admin'">

          <el-form
            :model="form"
            label-width="480px"
            ref="form"
          >
            <el-tabs  style="height: 600px">

              <el-card class="box-card">
                <div style="padding-top: 0; margin-bottom: 20px;">
                  <div class="clearfix" style="height: 60px; background-color: #8cc5ff;" >
                    <div style="display:inline-block; text-align: center; ">
                      <h3>环境暴露评估结果</h3>
                    </div>
                  </div>
                </div>
                <el-form-item label="" prop="id" v-if="false">
                  <el-input v-model="form.id" auto-complete="off"> </el-input>
                </el-form-item>

                <el-row>
                  <el-col :span="16">
                    <el-form-item label="STP微生物环境(PECstp)" prop="pecstp">
                      <el-tooltip class="item" effect="dark" :content="pecstpTip" placement="right">
                      <el-input v-model="form.pecstp"  auto-complete="off" readonly="readonly" >
                        <template slot="append">mg.L<sup>-1</sup></template> </el-input>
                      </el-tooltip>
                    </el-form-item>
                  </el-col>

                </el-row>

                <el-row>
                  <el-col :span="16">
                    <el-form-item label="地表水(PEClocal.water)" prop="peclocalWater">
                      <el-input v-model="form.peclocalWater " auto-complete="off" readonly="readonly">
                        <template slot="append">mg.L<sup>-1</sup></template></el-input>
                    </el-form-item>
                  </el-col>

                </el-row>

                <el-row>
                  <el-col :span="16">
                    <el-form-item label="沉积物(PEClocal.sed)" prop="peclocalSed" >
                      <el-input v-model="form.peclocalSed " auto-complete="off" readonly="readonly"><template slot="append">mg.kg<sup>-1</sup></template></el-input>
                    </el-form-item>
                  </el-col>


                </el-row>
                <el-row>
                  <el-col :span="16">
                    <el-form-item label="土壤(PEClocal.soil.30)" prop="peclocalSoil30">
                      <el-input v-model="form.peclocalSoil30 " auto-complete="off" readonly="readonly" ><template slot="append">mg.kg<sup>-1</sup></template></el-input>
                    </el-form-item>
                  </el-col>

                </el-row>

                <el-row>
                  <el-col :span="16">
                    <el-form-item label="地下水(PEClocal.grw)" prop="peclocalGrw" >
                      <el-input v-model="form.peclocalGrw " auto-complete="off" readonly="readonly"><template slot="append">mg.L<sup>-1</sup></template></el-input>
                    </el-form-item>
                  </el-col>

                </el-row>

                <el-row>
                  <el-col :span="16">
                    <el-form-item label="水生动物捕食者(PECaqu.predator)" prop="pecaquPredator" >
                      <el-input v-model="form.pecaquPredator " auto-complete="off" readonly="readonly"><template slot="append">mg·kg<sub>wwt</sub><sup>-1</sup></template></el-input>
                    </el-form-item>
                  </el-col>

                </el-row>
                <el-row>
                  <el-col :span="16">
                    <el-form-item label="陆生动物捕食者(PECter.predator)" prop="pecterPredator" v-if="true">
                      <el-input v-model="form.pecterPredator " auto-complete="off" readonly="readonly"><template slot="append">mg·kg<sub>wwt</sub><sup>-1</sup></template></el-input>
                    </el-form-item>
                  </el-col>


                </el-row>
              </el-card>

            </el-tabs>
          </el-form>
        </div>

        <!--管理员-->

        <div v-if="this.userName === 'admin'">

          <el-form
            :model="form"
            label-width="280px"
            ref="form"
          >
            <el-tabs  style="height: 600px">

              <el-card class="box-card">
                <div style="padding-top: 0; margin-bottom: 20px;">
                  <div class="clearfix" style="height: 60px; background-color: #8cc5ff;" >
                    <div style="display:block; text-align: center; ">
                      <div style="width:100%;">
                        <el-row>
                          <el-col :span="7" style="width: 50%; "> <h3>环境暴露评估结果</h3></el-col>
                          <el-col :span="7" style="width: 50%; " > <h3>环境风险表征(风险商)</h3></el-col>
                        </el-row>
                      </div>
                    </div>
                  </div>
                </div>

                <el-form-item label="" prop="id" v-if="false">
                  <el-input v-model="form.id" auto-complete="off"> </el-input>
                </el-form-item>

                <el-row>
                  <el-col :span="12">
                    <el-form-item label="STP微生物环境(PECstp)" prop="pecstp" v-if="true">
                      <el-tooltip class="item" effect="dark" :content="pecstpTip" placement="right">
                      <el-input v-model="form.pecstp "  auto-complete="off" readonly="readonly" >
                        <template slot="append">mg.L<sup>-1</sup></template> </el-input>
                      </el-tooltip>
                    </el-form-item>
                  </el-col>

                  <el-col :span="12" >
                    <el-form-item label="STP" prop="pecstppnec" v-if="true">
                      <el-input v-model="form.pecstpRcr"  auto-complete="off" readonly="readonly"></el-input>
                    </el-form-item>
                  </el-col>

                </el-row>

                <el-row>
                  <el-col :span="12">
                    <el-form-item label="地表水(PEClocal.water)" prop="peclocalWater" v-if="true" >
                      <el-input v-model="form.peclocalWater " auto-complete="off" readonly="readonly"><template slot="append">mg.L<sup>-1</sup></template></el-input>
                    </el-form-item>
                  </el-col>

                  <el-col :span="12" >
                    <el-form-item label="地表水" prop="peclocalWaterpnec" v-if="true" >
                      <el-input v-model="form.peclocalWaterRcr" auto-complete="off" readonly="readonly"></el-input>
                    </el-form-item>
                  </el-col>

                </el-row>

                <el-row>
                  <el-col :span="12">
                    <el-form-item label="沉积物(PEClocal.sed)" prop="peclocalSed" v-if="true">
                      <el-input v-model="form.peclocalSed " auto-complete="off" readonly="readonly"><template slot="append">mg.kg<sup>-1</sup></template></el-input>
                    </el-form-item>
                  </el-col>

                  <el-col :span="12" >
                    <el-form-item label="沉积物" prop="peclocalSedpnec" v-if="true">
                      <el-input v-model="form.peclocalSedRcr" auto-complete="off" readonly="readonly"></el-input>
                    </el-form-item>
                  </el-col>

                </el-row>
                <el-row>
                  <el-col :span="12">
                    <el-form-item label="土壤(PEClocal.soil.30)" prop="peclocalSoil30" v-if="true">
                      <el-input v-model="form.peclocalSoil30 " auto-complete="off" readonly="readonly" ><template slot="append">mg.kg<sup>-1</sup></template></el-input>
                    </el-form-item>
                  </el-col>

                  <el-col :span="12" >
                    <el-form-item label="土壤" prop="peclocalSoil30pnec" v-if="true">
                      <el-input v-model="form.peclocalSoil30Rcr" auto-complete="off" readonly="readonly"></el-input>
                    </el-form-item>
                  </el-col>

                </el-row>
                <el-row>
                  <el-col :span="12">
                    <el-form-item label="地下水(PEClocal.grw)" prop="peclocalGrw" v-if="true">
                      <el-input v-model="form.peclocalGrw " auto-complete="off" readonly="readonly"><template slot="append">mg.L<sup>-1</sup></template></el-input>
                    </el-form-item>
                  </el-col>

                  <el-col :span="12" >
                    <el-form-item label="地下水" prop="peclocalGrwpnec" v-if="true">
                      <el-input v-model="form.peclocalGrwRcr" auto-complete="off" readonly="readonly"></el-input>
                    </el-form-item>
                  </el-col>

                </el-row>

                <el-row>
                  <el-col :span="12">
                    <el-form-item label="水生动物捕食者(PECaqu.predator)" prop="pecaquPredator" v-if="true">
                      <el-input v-model="form.pecaquPredator " auto-complete="off" readonly="readonly"><template slot="append">mg·kg<sub>wwt</sub><sup>-1</sup></template></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12" >
                    <el-form-item label="水生捕食动物" prop="pecaquPredatorpnec" v-if="true">
                      <el-input v-model="form.pecaquPredatorRcr" auto-complete="off" readonly="readonly"></el-input>
                    </el-form-item>
                  </el-col>

                </el-row>
                <el-row>
                  <el-col :span="12">
                    <el-form-item label="陆生动物捕食者(PECter.predator)" prop="pecterPredator" v-if="true">
                      <el-input v-model="form.pecterPredator " auto-complete="off" readonly="readonly"><template slot="append">mg·kg<sub>wwt</sub><sup>-1</sup></template></el-input>
                    </el-form-item>
                  </el-col>

                  <el-col :span="12" >
                    <el-form-item label="陆生捕食动物" prop="pecterPredatorpnec" v-if="true">
                      <el-input v-model="form.pecterPredatorRcr" auto-complete="off" readonly="readonly"></el-input>
                    </el-form-item>
                  </el-col>

                </el-row>
              </el-card>

            </el-tabs>
          </el-form>
        </div>



        <!--健康暴露-->

        <div v-if="this.userName !== 'admin'">

          <el-form
            :model="form"
            label-width="480px"
            ref="form"
          >
            <el-tabs tab-position="top" style="height: 600px" >

              <el-card class="box-card">
                <div style="padding-top: 0; margin-bottom: 20px;">
                  <div class="clearfix" style="height: 60px; background-color: #8cc5ff;" >
                    <div style="display:inline-block; text-align: center; ">
                      <h3>健康暴露评估结果</h3>
                    </div>
                  </div>
                </div>

                <el-row>
                  <el-col :span="16">
                    <el-form-item label="吸入(ADDinh)" prop="addinh" v-if="true">
                      <el-input v-model="form.addinh" auto-complete="off" readonly="readonly"><template slot="append">mg·kg<sub>wwt</sub><sup>-1</sup></template></el-input>
                    </el-form-item>
                  </el-col>

                </el-row>
                <el-row>
                  <el-col :span="16">
                    <el-form-item label="饮水(ADDoral.water)" prop="addoralWater" v-if="true">
                      <el-input v-model="form.addoralWater " auto-complete="off" readonly="readonly"><template slot="append">mg·kg<sub>wwt</sub><sup>-1</sup></template></el-input>
                    </el-form-item>
                  </el-col>

                </el-row>
                <el-row>
                  <el-col :span="16">
                    <el-form-item label="经口摄食(鱼)(ADDoral.food )" prop="addoralFood" v-if="true">
                      <el-input v-model="form.addoralFood " auto-complete="off" readonly="readonly" ><template slot="append">mg·kg<sub>wwt</sub><sup>-1</sup></template></el-input>
                    </el-form-item>
                  </el-col>

                </el-row>
                <el-row>
                  <el-col :span="16">
                    <el-form-item label="不同途径总暴露量(ADDT)" prop="addt" v-if="true">
                      <el-input v-model="form.addt " auto-complete="off" readonly="readonly"><template slot="append">mg·kg<sub>wwt</sub><sup>-1</sup></template></el-input>
                    </el-form-item>
                  </el-col>


                </el-row>
              </el-card>
            </el-tabs>
          </el-form>
        </div>

        <!--管理员-->

        <div v-if="this.userName === 'admin'">

          <el-form
            :model="form"
            label-width="280px"
            ref="form"
          >
            <el-tabs tab-position="top" style="height: 600px" >
              <el-card class="box-card">
                <div style="padding-top: 0; margin-bottom: 20px;">
                  <div class="clearfix" style="height: 60px; background-color: #8cc5ff;" >
                    <div style="display:block; text-align: center; ">
                      <div style="width:100%;">
                        <el-row>
                          <el-col :span="7" style="width: 50%; "> <h3>健康暴露评估结果</h3></el-col>
                          <el-col :span="7" style="width: 50%; " > <h3>健康风险表征(风险商)</h3></el-col>
                        </el-row>
                      </div>
                    </div>
                  </div>
                </div>
                <el-row>
                  <el-col :span="12">
                    <el-form-item label="吸入(ADDinh)" prop="addinh" v-if="true">
                      <el-input v-model="form.addinh" auto-complete="off" readonly="readonly"><template slot="append">mg·kg<sub>wwt</sub><sup>-1</sup></template></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12" >
                    <el-form-item label="吸入" prop="addinh" v-if="true">
                      <el-input v-model="form.addinhRcr" auto-complete="off" readonly="readonly"></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :span="12">
                    <el-form-item label="饮水(ADDoral.water)" prop="addoralWater" v-if="true">
                      <el-input v-model="form.addoralWater " auto-complete="off" readonly="readonly"><template slot="append">mg·kg<sub>wwt</sub><sup>-1</sup></template></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12" >
                    <el-form-item label="饮水" prop="addoralWater" v-if="true">
                      <el-input v-model="form.addoralWaterRcr" auto-complete="off" readonly="readonly"></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :span="12">
                    <el-form-item label="经口摄食(鱼)(ADDoral.food )" prop="addoralFood" v-if="true">
                      <el-input v-model="form.addoralFood " auto-complete="off" readonly="readonly" ><template slot="append">mg·kg<sub>wwt</sub><sup>-1</sup></template></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12" >
                    <el-form-item label="经口摄食(鱼)" prop="addoralFood" v-if="true">
                      <el-input v-model="form.addoralFoodRcr" auto-complete="off" readonly="readonly"></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :span="12">
                    <el-form-item label="不同途径总暴露量(ADDT)" prop="addt" v-if="true">
                      <el-input v-model="form.addt " auto-complete="off" readonly="readonly"><template slot="append">mg·kg<sub>wwt</sub><sup>-1</sup></template></el-input>
                    </el-form-item>
                  </el-col>

                  <el-col :span="12" >
                    <el-form-item label="不同途径总暴露量(ADDT)" prop="addt" v-if="true">
                      <el-input v-model="form.addtRcr" auto-complete="off" readonly="readonly"></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
              </el-card>
            </el-tabs>
          </el-form>
        </div>
      </div>




  </div>

    <el-dialog :title="operation ? '添加' : '编辑'" width="50%" :visible.sync="editDialogVisible"
               :close-on-click-modal="false">
      <el-form :model="form" label-width="280px" :rules="formRules" ref="form" :size="size">
        <el-tabs tab-position="left">

          <el-form-item label="" prop="id" v-if="false">
            <el-input v-model="form.id" auto-complete="off"></el-input>
          </el-form-item>
          <el-form-item label="生命周期阶段" prop="lifeCycle" v-if="true">
            <el-select style="width: 100%;" v-model="form.lifeCycle" placeholder="请选择" @change="changeEmission">
              <el-option
                v-for="item in options"
                :key="item.label"
                :label="item.label"
                :value="item.label">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="暴露场景短标题" prop="title" v-if="this.operation" >
            <el-input v-model="form.title" auto-complete="off"></el-input>
          </el-form-item>
          <el-form-item label="备注" prop="remark" v-if="true">
            <el-input v-model="form.remark" auto-complete="off"></el-input>
          </el-form-item>

        </el-tabs>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button :size="size" @click.native="editDialogVisible = false">{{
          $t("action.cancel")
          }}</el-button>
        <el-button :size="size" type="primary" @click.native="submitForm" :loading="editLoading">
          {{ $t("action.submit") }}</el-button>
      </div>
    </el-dialog>


  </div>
</template>

<script>
  export default {
    name: "Scenes",
    data(){
      return{
        userName: '',
        scene_show: true,
        results_show: false,
        button_show: true,
        scrollHeight: '100%',
        operation: false, // true:新增, false:编辑
        editDialogVisible: false, // 新增编辑界面是否显示
        editLoading: false,
        pecstpTip: '',
        elocalWaterTip: '修改',
        elocalstpWaterTip: '修改',
        elocalDirectwaterTip: '修改',
        elocalAirTip: '修改',
        elocalstpAirTip: '修改',
        elocalSoilTip: '修改',
        temissionTip: '修改',
        mainTip: '修改',
        fmainTip: '修改',
        effluentTip: '修改',
        flowTip: '修改',
        fregTip: '修改',
        flocalTip: '修改',
        fvariabilityTip: '修改',
        fdirectwaterTip: '修改',
        isLife: false,
        isEmission: false,
        fstpWater: 0,
        fstpWater2: 0,
        fstpAir: 0,
        fstpAir2: 0,
        fstpSludge: 0,
        fstpSludge2: 0,
        fstpDegrade: 0,
        fstpDegrade2: 0,
        elocalWater_disabled: true,
        elocalstpWater_disabeld: true,
        elocalDirectwater_disabled: true,
        elocalAir_disabled: true,
        elocalstpAir_disabled: true,
        elocalSoil_disabled: true,
        elocalstpSoil_disabled: true,
        isCompute: true,
        isStponsite: true,
        isWaterto: false,
        isRouterAlive: true,
        effluent_disabled: true,
        flow_disabled: true,
        flocal_disabled: true,
        qchemical_disabled: true,
        title_disabled: true,
        temission_disabled: true,
        freg_disabled: true,
        fvariability_disabled: true,
        main_disabled: true,
        fmain_disabled: true,
        fdirectwater_disabled: true,
        abatementWater_disabled: true,
        useSource: '',
        input_show: false,
        industrial_disabled: false,
        consume_disabled: false,
        waste_disabled: false,
        compute_disabled: false,
        stponsite_disabled: false,
        stp_disabled: true,
        // 新增编辑界面数据
        tableData: null,
        scenes: [],
        maxIndex: '',
        formRules: {
          lifeCycle: [{
            required: true,
            message: '请选择生命周期阶段',
            trigger: 'blur'
          }],
          qchemical: [{
            required: true,
            message: '年生产、使用或废物利用处理量不能为空',
            trigger: 'blur'
          }],
          title: [{
            required: true,
            message: '暴露场景短标题不能为空',
            trigger: 'blur'
          }],
        },
        form:{
          id: '',
          cas: 'string',
          wzmc: '',
          lifeCycle: '',//生命周期阶段
          title: '',
          qchemical: '',
          remark: '',
          temission: 365,
          freg: 0.1,
          main: 1,
          fmain: 0.1,
          emissionPattern: '2',
          fvariability: 4,
          fdirectwater: 0.5,
          stpEffluent: 2000,
          flow: 18000,
          flocal: 0.0005,
          water: 0,
          air: 0,
          sludge: 0,
          abatementWater: 0,
          abatementAir: 0,
          abatementSludge: 0,
          stponsite: '',
          stponsiteWater: 0,
          stponsiteAir: 0,
          stponsiteSludge: 0,
          stponsiteDegrade: 0,
          waterTo: '',
          publicStp: '',
          stpWater: 0,
          stpAir: 0,
          stpSludge: 0,
          stpDegrade: 0,
          appLsludge: '',

          //废物处置利用源使用
          waste: 0,

          elocalWater: 0, //直排时为0
          elocalDirectwater: 0, //进入公共STP时为0
          elocalAir: 0,
          elocalstpAir: 0, //经过公共STP处理后大气排放，直排时为0
          elocalSoil: 0,
          elocalstpSoil: 0,
          elocalstpWater: 0, //经过公共STP处理后水排放，直排时为0

          pecstp: null,
          peclocalWater: null,
          peclocalSed: null,
          peclocalSoil30: null,
          peclocalGrw: null,
          pecaquPredator: null,
          pecterPredator: null,
          addinh: null,
          addoralWater: null,
          addoralFood: null,
          addt: null,

          pecstpRcr:'',
          peclocalWaterRcr:'',
          peclocalSedRcr:'',
          peclocalSoil30Rcr:'',
          peclocalGrwRcr:'',
          pecaquPredatorRcr:'',
          pecterPredatorRcr:'',
          addinhRcr:'',
          addoralWaterRcr:'',
          addoralFoodRcr:'',
          addtRcr:'',

        },

        size: "small",
        options: [{
          value: '选项1',
          label: '生产'
        }, {
          value: '选项2',
          label: '配制'
        }, {
          value: '选项3',
          label: '工业使用'
        }, {
          value: '选项4',
          label: '消费使用'
        }, {
          value: '选项5',
          label: '废物利用处置'
        }],

        options2: [{
          value: '选项1',
          label: '标准STP'
        }, {
          value: '选项2',
          label: '自行输入'
        }, {
          value: '选项3',
          label: '无'
        },],

        message: '',
        active: 0,

        density:{},
        parameter:{},
        output:{},
        cas:null,
        PECstp: null,   //PECstp...ADDT存储output结果
        PEClocal_water:null,
        PEClocal_sed:null,
        PEClocalsoil_30:null,
        PEClocal_grw: null,
        PECaqu_predator: null,
        PECter_predator: null,
        ADDinh: null,
        ADDoral_water: null,
        ADDoral_food: null,
        ADDT: null,
        result:{},

        //EFFLUENTstp: 2000,
        er: 0,
        SUSPwater: 15,
        FLOW: 18000,
        KPsusp: 2.05,
        SUSPWtaer: 15,
        Elocaldirectwater: 0,
        PECregWatter: 15,

        //风险评估系数  加在parameter表中，目前以静态数值进行测试
        pecstpPnec:1,        //风险表征系数  ...Pnec
        peclocalWaterPnec:1,
        peclocalSedPnec:1,
        peclocalSoil30Pnec:1,
        peclocalGrwPnec:1,
        pecaquPredatorPnec:1,
        pecterPredatorPnec:1,
        addinhDnel:1,       //风险表征系数  ...Pnec
        addoralWaterDnel:1,
        addoralFoodDnel:1,
        addtDnel:1,

      }
    },
    mounted(){
      this.userName = sessionStorage.getItem("user");
      this.scrollHeight = window.innerHeight* 0.8 + 'px';
    },
    created(){
      this.form.cas = this.$store.getters.getCas;
      this.form.wzmc = this.$store.getters.getWzmc;
      if(this.$store.getters.getResultflag){
        this.scene_show = false;
        this.results_show = true;
        this.button_show = false;
      }
      else{
        this.scene_show = true;
        this.results_show = false;
        this.button_show = true;
      }
      //console.log("created_cas:",this.form.cas);
      let cas = {cas:this.form.cas,};
      this.$api.output.findByCas(cas).then((res) => {
        if(res.data.length > 0){
          this.isLife = false;
         // console.log("created_scenes:",res.data);
          this.scenes = res.data;
          this.maxIndex = this.scenes.length-1 + '';
          this.showScenes(this.scenes[this.scenes.length-1],this.scenes.length-1);
        }
        else{
          this.isLife = true;
        }
      });
      // this.$api.input.findByCas(cas).then((res) => {
      //   if(res.data!= null){
      //     this.input = res.data;
      //   }
      //   console.log("input123:",this.input);
      //
      // })
      this.$api.density.findByCas(cas).then((res) => {
        if(res.data!=null){

          //获取标准STP归趋结果
          this.fstpWater = res.data.fstpWater;
          this.fstpWater2 = res.data.fstpWater2;
          this.fstpAir = res.data.fstpAir;
          this.fstpAir2 = res.data.fstpAir2;
          this.fstpSludge = res.data.fstpSludge;
          this.fstpSludge2 = res.data.fstpSludge2;
          this.fstpDegrade = res.data.fstpDegrade;
          this.fstpDegrade2 = res.data.fstpDegrade2;

          // if(this.form.stponsite === '标准STP'){
          //   if(this.form.emissionPattern === '1'){
          //     this.form.stponsiteWater = res.data.fstpWater;
          //     this.form.stponsiteAir = res.data.fstpAir;
          //     this.form.stponsiteSludge = res.data.fstpSludge;
          //     this.form.stponsiteDegrade = res.data.fstpDegrade;
          //   }
          //   if(this.form.emissionPattern === '2'){
          //     this.form.stponsiteWater = res.data.fstpWater2;
          //     this.form.stponsiteAir = res.data.fstpAir2;
          //     this.form.stponsiteSludge = res.data.fstpSludge2;
          //     this.form.stponsiteDegrade = res.data.fstpDegrade2;
          //   }
          // }
          // if(this.form.publicStp === '1') {
          //   if(this.form.emissionPattern === '1'){
          //     this.form.stpWater = res.data.fstpWater;
          //     this.form.stpAir = res.data.fstpAir;
          //     this.form.stpSludge = res.data.fstpSludge;
          //     this.form.stpDegrade = res.data.fstpDegrade;
          //   }
          //   if(this.form.emissionPattern === '2'){
          //     this.form.stpWater = res.data.fstpWater2;
          //     this.form.stpAir = res.data.fstpAir2;
          //     this.form.stpSludge = res.data.fstpSludge2;
          //     this.form.stpDegrade = res.data.fstpDegrade2;
          //   }
          // }

          //从数据中获取Density值
          this.density = res.data;
          this.pecstpPnec=this.density.pecstpPnec;
          this.peclocalWaterPnec=this.density.peclocalWaterPnec;
          this.peclocalSedPnec=this.density.peclocalSedPnec;
          this.peclocalSoil30Pnec=this.density.peclocalSoil30Pnec;
          this.peclocalGrwPnec=this.density.peclocalGrwPnec;
          this.pecaquPredatorPnec=this.density.pecaquPredatorPnec;
          this.pecterPredatorPnec=this.density.pecterPredatorPnec;
          this.addoralWaterDnel=this.density.addoralWaterDnel;
          this.addinhDnel=this.density.addinhDnel;
          this.addoralFoodDnel=this.density.addoralFoodDnel;
          this.addtDnel=this.density.addtDnel;
        }
       console.log("created_Density对象:",this.density);
      });

      //获取Parameter值
      this.$api.parameter.findByCas({cas:this.$store.getters.getCas}).then((res) => {
        this.parameter = res.data;
        console.log("created_parameter对象:",this.parameter);
      });

      this.$store.commit('setFlag', !this.$store.getters.getFlag);
    },
    computed: {
      stp() {
        return this.$store.getters.getStp;
      },
      densityWatch() {
          return this.$store.getters.getDensityflag;
      },
      parameterWatch() {
            return this.$store.getters.getParameterflag;
      },
      casWatch(){
        return this.$store.getters.getCas;
      },
      idWatch(){
        return this.$store.getters.getId;
      },
      wzmcWatch(){
        return this.$store.getters.getWzmc;
      },
      resultWatch(){
        return this.$store.getters.getResultflag;
      },
    },
   watch:{
      resultWatch: function(newVal, oldVal){
        if(newVal){
          this.scene_show = false;
          this.results_show = true;
          this.button_show = false;
        }
       else{
         this.scene_show = true;
         this.results_show = false;
         this.button_show = true;
        }
      },
     idWatch: function(newVal, oldValue) {
       if(newVal !== ''){
       this.maxIndex = newVal + '';
       this.showScenes(this.scenes[newVal],newVal);
       }
     },
      'form.water': function(newVal, oldValue) {
        if (parseFloat(newVal) < 0 || parseFloat(newVal) > 1) {
          this.form.airPfxs = ''
          this.$message({
            message: '数值只能在0-1之间',
            type: 'warning'
          })
        }
      },
      'form.air': function(newVal, oldValue) {
          if (parseFloat(newVal) < 0 || parseFloat(newVal) > 1) {
            this.form.airPfxs = ''
            this.$message({
              message: '数值只能在0-1之间',
              type: 'warning'
            })
          }
        },
        'form.sludge': function(newVal, oldValue) {
            if (parseFloat(newVal) < 0 || parseFloat(newVal) > 1) {
              this.form.airPfxs = ''
              this.$message({
                message: '数值只能在0-1之间',
                type: 'warning'
              })
            }
          },
     'form.abatementWater': function(newVal, oldValue) {
            if (parseFloat(newVal) < 0 || parseFloat(newVal) > 1) {
              this.form.airPfxs = ''
              this.$message({
                message: '数值只能在0-1之间',
                type: 'warning'
              })
            }
          },
     'form.abatementAir': function(newVal, oldValue) {
    if (parseFloat(newVal) < 0 || parseFloat(newVal) > 1) {
      this.form.airPfxs = ''
      this.$message({
        message: '数值只能在0-1之间',
        type: 'warning'
      })
    }
  },
  'form.abatementSludge': function(newVal, oldValue) {
    if (parseFloat(newVal) < 0 || parseFloat(newVal) > 1) {
      this.form.airPfxs = ''
      this.$message({
        message: '数值只能在0-1之间',
        type: 'warning'
      })
    }
  },
      wzmcWatch: function(newVal, oldVal){
        this.form.wzmc = newVal;
      },
      casWatch: function (newVal, oldVal) {
         /* this.$store.commit('setId',0);*/
        //console.log("cas_newVal:",newVal);
        this.form.cas = newVal;
        let cas = {cas:this.form.cas,};
        this.$api.output.findByCas(cas).then((res) => {
          if(res.data.length > 0){
            this.isLife = false;
            this.input_show = true;
            this.isEmission = true;
            this.scenes = res.data;
            this.maxIndex = this.scenes.length-1 + '';
            this.showScenes(this.scenes[this.scenes.length-1],this.scenes.length-1);
          }
          else if(res.data.length === 0){
            this.form.lifeCycle = '',
              this.isEmission = false;
            this.input_show = false;
            this.isLife = true;
            this.scenes = res.data;
          }
          else{
            this.form.lifeCycle = '',
              this.input_show = false;
            this.isEmission = false;
            this.isLife = true;
          }
        });
        this.$api.density.findByCas(cas).then((res) => {
          if(res.data !=null){

            //获取标准STP归趋结果
            this.fstpWater = res.data.fstpWater;
            this.fstpWater2 = res.data.fstpWater;
            this.fstpAir = res.data.fstpAir;
            this.fstpAir2 = res.data.fstpAir2;
            this.fstpSludge = res.data.fstpSludge;
            this.fstpSludge2 = res.data.fstpSludge2;
            this.fstpDegrade = res.data.fstpDegrade;
            this.fstpDegrade2 = res.data.fstpDegrade2;

            if(this.form.stponsite === '标准STP'){
              if(this.form.emissionPattern === '1'){
                this.form.stponsiteWater = res.data.fstpWater;
                this.form.stponsiteAir = res.data.fstpAir;
                this.form.stponsiteSludge = res.data.fstpSludge;
                this.form.stponsiteDegrade = res.data.fstpDegrade;
              }
              if(this.form.emissionPattern === '2'){
                this.form.stponsiteWater = res.data.fstpWater2;
                this.form.stponsiteAir = res.data.fstpAir2;
                this.form.stponsiteSludge = res.data.fstpSludge2;
                this.form.stponsiteDegrade = res.data.fstpDegrade2;
              }
            }
            if(this.form.publicStp === '1') {
              if(this.form.emissionPattern === '1'){
                this.form.stpWater = res.data.fstpWater;
                this.form.stpAir = res.data.fstpAir;
                this.form.stpSludge = res.data.fstpSludge;
                this.form.stpDegrade = res.data.fstpDegrade;
              }
              if(this.form.emissionPattern === '2'){
                this.form.stpWater = res.data.fstpWater2;
                this.form.stpAir = res.data.fstpAir2;
                this.form.stpSludge = res.data.fstpSludge2;
                this.form.stpDegrade = res.data.fstpDegrade2;
              }
            }

              this.density = res.data;
              this.pecstpPnec=this.density.pecstpPnec;
              this.peclocalWaterPnec=this.density.peclocalWaterPnec;
              this.peclocalSedPnec=this.density.peclocalSedPnec;
              this.peclocalSoil30Pnec=this.density.peclocalSoil30Pnec;
              this.peclocalGrwPnec=this.density.peclocalGrwPnec;
              this.pecaquPredatorPnec=this.density.pecaquPredatorPnec;
              this.pecterPredatorPnec=this.density.pecterPredatorPnec;
              this.addoralWaterDnel=this.density.addoralWaterDnel;
              this.addinhDnel=this.density.addinhDnel;
              this.addoralFoodDnel=this.density.addoralFoodDnel;
              this.addtDnel=this.density.addtDnel;
          }
         console.log("caswatch_density:",this.density);
        })
        this.$api.parameter.findByCas({cas:this.$store.getters.getCas}).then((res) => {
          this.parameter = res.data;
         console.log("caswatch_parameter:",this.parameter);
        });
      },
      stp: function (newVal, oldVal) {
       this.form.cas = this.$store.getters.getCas;
       // console.log("stp_cas:",this.form.cas);
        let cas = {cas:this.form.cas,};

        this.$api.density.findByCas(cas).then((res) => {
          if(res.data!=null){

            this.density = res.data;

            //获取标准STP归趋结果
            this.fstpWater = res.data.fstpWater;
            this.fstpWater2 = res.data.fstpWater2;
            this.fstpAir = res.data.fstpAir;
            this.fstpAir2 = res.data.fstpAir2;
            this.fstpSludge = res.data.fstpSludge;
            this.fstpSludge2 = res.data.fstpSludge2;
            this.fstpDegrade = res.data.fstpDegrade;
            this.fstpDegrade2 = res.data.fstpDegrade2;

            if(this.form.stponsite === '标准STP'){
              if(this.form.emissionPattern === '1'){
                this.form.stponsiteWater = res.data.fstpWater;
                this.form.stponsiteAir = res.data.fstpAir;
                this.form.stponsiteSludge = res.data.fstpSludge;
                this.form.stponsiteDegrade = res.data.fstpDegrade;
              }
              if(this.form.emissionPattern === '2'){
                this.form.stponsiteWater = res.data.fstpWater2;
                this.form.stponsiteAir = res.data.fstpAir2;
                this.form.stponsiteSludge = res.data.fstpSludge2;
                this.form.stponsiteDegrade = res.data.fstpDegrade2;
              }
            }
            if(this.form.publicStp === '1') {
              if(this.form.emissionPattern === '1'){
                this.form.stpWater = res.data.fstpWater;
                this.form.stpAir = res.data.fstpAir;
                this.form.stpSludge = res.data.fstpSludge;
                this.form.stpDegrade = res.data.fstpDegrade;
              }
              if(this.form.emissionPattern === '2'){
                this.form.stpWater = res.data.fstpWater2;
                this.form.stpAir = res.data.fstpAir2;
                this.form.stpSludge = res.data.fstpSludge2;
                this.form.stpDegrade = res.data.fstpDegrade2;
              }
            }


            this.pecstpPnec=this.density.pecstpPnec;
            this.peclocalWaterPnec=this.density.peclocalWaterPnec;
            this.peclocalSedPnec=this.density.peclocalSedPnec;
            this.peclocalSoil30Pnec=this.density.peclocalSoil30Pnec;
            this.peclocalGrwPnec=this.density.peclocalGrwPnec;
            this.pecaquPredatorPnec=this.density.pecaquPredatorPnec;
            this.pecterPredatorPnec=this.density.pecterPredatorPnec;
            this.addoralWaterDnel=this.density.addoralWaterDnel;
            this.addinhDnel=this.density.addinhDnel;
            this.addoralFoodDnel=this.density.addoralFoodDnel;
            this.addtDnel=this.density.addtDnel;
          }
          //console.log("Parameter:",this.parameter);
        })

      },
       densityWatch: function (newVal, oldVal) {
           this.form.cas = this.$store.getters.getCas;
           //console.log("stp_cas:",this.form.cas);
           let cas = {cas:this.form.cas,};
         //console.log("densityWatch成功！！！");
           this.$api.density.findByCas(cas).then((res) => {
               if(res.data!=null){
                 this.density = res.data;
                   //获取标准STP归趋结果
                 this.fstpWater = res.data.fstpWater;
                 this.fstpWater2 = res.data.fstpWater2;
                 this.fstpAir = res.data.fstpAir;
                 this.fstpAir2 = res.data.fstpAir2;
                 this.fstpSludge = res.data.fstpSludge;
                 this.fstpSludge2 = res.data.fstpSludge2;
                 this.fstpDegrade = res.data.fstpDegrade;
                 this.fstpDegrade2 = res.data.fstpDegrade2;
                   if(this.form.stponsite === '标准STP'){
                     if(this.form.emissionPattern === '1'){
                       this.form.stponsiteWater = res.data.fstpWater;
                       this.form.stponsiteAir = res.data.fstpAir;
                       this.form.stponsiteSludge = res.data.fstpSludge;
                       this.form.stponsiteDegrade = res.data.fstpDegrade;
                     }
                     if(this.form.emissionPattern === '2'){
                       this.form.stponsiteWater = res.data.fstpWater2;
                       this.form.stponsiteAir = res.data.fstpAir2;
                       this.form.stponsiteSludge = res.data.fstpSludge2;
                       this.form.stponsiteDegrade = res.data.fstpDegrade2;
                     }
                   }
                   if(this.form.publicStp === '1') {
                     if(this.form.emissionPattern === '1'){
                       this.form.stpWater = res.data.fstpWater;
                       this.form.stpAir = res.data.fstpAir;
                       this.form.stpSludge = res.data.fstpSludge;
                       this.form.stpDegrade = res.data.fstpDegrade;
                     }
                     if(this.form.emissionPattern === '2'){
                       this.form.stpWater = res.data.fstpWater2;
                       this.form.stpAir = res.data.fstpAir2;
                       this.form.stpSludge = res.data.fstpSludge2;
                       this.form.stpDegrade = res.data.fstpDegrade2;
                     }
                   }

                   this.pecstpPnec=this.parameter.pecstpPnec;
                   this.peclocalWaterPnec=this.parameter.peclocalWaterPnec;
                   this.peclocalSedPnec=this.parameter.peclocalSedPnec;
                   this.peclocalSoil30Pnec=this.parameter.peclocalSoil30Pnec;
                   this.peclocalGrwPnec=this.parameter.peclocalGrwPnec;
                   this.pecaquPredatorPnec=this.parameter.pecaquPredatorPnec;
                   this.pecterPredatorPnec=this.parameter.pecterPredatorPnec;
                   this.addoralWaterDnel=this.parameter.addoralWaterDnel;
                   this.addinhDnel=this.parameter.addinhDnel;
                   this.addoralFoodDnel=this.parameter.addoralFoodDnel;
                   this.addtDnel=this.parameter.addtDnel;
               }
               //console.log("Parameter:",this.parameter);
           })
       },
       parameterWatch: function (newVal, oldVal) {
           this.form.cas = this.$store.getters.getCas;
           //console.log("stp_cas:",this.form.cas);
           let cas = {cas:this.form.cas,};
           //console.log("parameterWatch成功！！！");
           this.$api.parameter.findByCas({cas:this.$store.getters.getCas}).then((res) => {
               this.parameter = res.data;
               //console.log("density:",this.density);
           });
       }
      },
    methods:{
      handleOpen(key, keyPath) {
       // console.log(key, keyPath);
      },
      handleClose(key, keyPath) {
       // console.log(key, keyPath);
      },
      getScenes(data){
        let cas = {cas:data,};
        this.$api.output.findByCas(cas).then((res) => {
          if(res.data.length > 0){
            this.isLife = false;
            this.scenes = res.data;
            this.maxIndex = this.scenes.length-1 + '';
            this.showScenes(this.scenes[this.scenes.length-1],this.scenes.length-1);
          }
          else{
            this.isLife = true;
          }
        });
      },
      changeElocalwater(){
        this.elocalWater_disabled = !this.elocalWater_disabled;
        // if(this.elocalWater_disabled){
        //   this.elocalWaterTip = '修改';
        // }
        // else{
        //   this.elocalWaterTip='使用计算值'
        // }
      },
      changeElocalstpwater(){
        this.elocalstpWater_disabeld = !this.elocalstpWater_disabeld;
        // if(this.elocalstpWater_disabeld){
        //   this.elocalstpWaterTip = '修改';
        // }
        // else{
        //   this.elocalstpWaterTip='使用计算值'
        // }
      },
      changeElocaldirectwater(){
        this.elocalDirectwater_disabled = !this.elocalDirectwater_disabled;
        // if(this.elocalDirectwater_disabled){
        //   this.elocalDirectwaterTip = '修改';
        // }
        // else{
        //   this.elocalDirectwaterTip='使用计算值'
        // }
      },
      changeElocalair(){
        this.elocalAir_disabled = !this.elocalAir_disabled;
        // if(this.elocalAir_disabled){
        //   this.elocalAirTip = '修改';
        // }
        // else{
        //   this.elocalAirTip='使用计算值'
        // }
      },
      changeElocalstpair(){
        this.elocalstpAir_disabled = !this.elocalstpAir_disabled;
        // if(this.elocalstpAir_disabled){
        //   this.elocalstpAirTip = '修改';
        // }
        // else{
        //   this.elocalstpAirTip='使用计算值'
        // }
      },
      changeElocalsoil(){
        this.elocalSoil_disabled = !this.elocalSoil_disabled;
        // if(this.elocalSoil_disabled){
        //   this.elocalSoilTip = '修改';
        // }
        // else{
        //   this.elocalSoilTip='使用计算值'
        // }
      },
      changeElocalstpsoil(){
        this.elocalstpSoil_disabled = !this.elocalstpSoil_disabled;
      },
      showScenes(item,sceneid){
        console.log("showscenes的item：",item);
        this.isEmission = false;
        this.input_show = false;
        this.industrial_disabled = false;
        this.consume_disabled = false;
        this.waste_disabled = false;
        this.compute_disabled = false;
        if (item.waterTo === '1') {
          this.isWaterto = false;
        }
        else if (item.waterTo === '2'){
          this.isWaterto = true;
        }
        if(item.lifeCycle === '生产' || item.lifeCycle === '配制' || item.lifeCycle === '工业使用' || item.lifeCycle === '废物利用处置'){
          if(item.waterTo === '1'){
            this.pecstpTip = '企业自有STP PEC';
          }
          if(item.waterTo === '2'){
            this.pecstpTip = '集中式STP PEC';
          }
        }
        if(item.lifeCycle === '消费使用'){
          this.pecstpTip = '';
        }

        if(item.lifeCycle === '消费使用'){
          this.isEmission = true;
          this.input_show = true;
          this.industrial_disabled = false;
          this.consume_disabled = true;
          this.waste_disabled = false;
          this.useSource = '消费源';
        }
        else if(item.lifeCycle === '废物利用处置'){
          this.isEmission = true;
          this.input_show = true;
          this.industrial_disabled = false;
          this.consume_disabled = false;
          this.waste_disabled = true;
          this.useSource = '废物处置利用源';
        }
        else if(item.lifeCycle === '生产' || item.lifeCycle === '配制' || item.lifeCycle === '工业使用'){
          this.isEmission = true;
          this.input_show = true;
          this.industrial_disabled = true;
          this.consume_disabled = false;
          this.waste_disabled = false;
          this.useSource = '工业源';
        }
        if(item.stponsite === '自行输入' || item.stponsite === '标准STP'){
          this.stponsite_disabled = true;
        }
        else{
          this.stponsite_disabled = false;
        }
        if(item.publicStp === '2'){
          this.stp_disabled = false;
        }
        else{
          this.stp_disabled = true;
        }
        this.form.id = item.id;
        this.form.title = item.title;
        this.form.remark = item.remark;
        this.form.lifeCycle = item.lifeCycle;
        this.form.qchemical = item.qchemical;
        this.form.temission = item.temission;
        this.form.main = item.main;
        this.form.fmain = item.fmain;
        this.form.emissionPattern = item.emissionPattern;
        this.form.waste = item.waste;
        this.form.water = item.water;
        this.form.air = item.air;
        this.form.sludge = item.sludge;
        this.form.abatementWater = item.abatementWater;
        this.form.abatementAir = item.abatementAir;
        this.form.abatementSludge = item.abatementSludge;
        this.form.stponsite = item.stponsite;
        this.form.stponsiteWater = item.stponsiteWater;
        this.form.stponsiteAir = item.stponsiteAir;
        this.form.stponsiteSludge = item.stponsiteSludge;
        this.form.stponsiteDegrade = item.stponsiteDegrade;
        this.form.waterTo = item.waterTo;
        this.form.publicStp = item.publicStp;
        this.form.stpWater = item.stpWater;
        this.form.stpAir = item.stpAir;
        this.form.stpSludge = item.stpSludge;
        this.form.stpDegrade = item.stpDegrade;
        this.form.appLsludge = item.appLsludge;
        this.form.stpEffluent = item.stpEffluent;
        this.form.flow = item.flow;
        this.form.freg = item.freg;
        this.form.flocal = item.flocal;
        this.form.fvariability = item.fvariability;
        this.form.fdirectwater = item.fdirectwater;

        this.form.pecstp = this.NumberJudge(item.pecstp);
        this.form.peclocalWater = this.NumberJudge(item.peclocalWater);
        this.form.peclocalSed = this.NumberJudge(item.peclocalSed);
        this.form.peclocalSoil30 = this.NumberJudge(item.peclocalSoil30);
        this.form.peclocalGrw = this.NumberJudge(item.peclocalGrw);
        this.form.pecaquPredator = this.NumberJudge(item.pecaquPredator);
        this.form.pecterPredator = this.NumberJudge(item.pecterPredator);
        this.form.addinh = this.NumberJudge(item.addinh);
        this.form.addoralWater = this.NumberJudge(item.addoralWater);
        this.form.addoralFood = this.NumberJudge(item.addoralFood);
        this.form.addt = this.NumberJudge(item.addt);
        // this.form.pecstp = this.NumberJudge(item.pecstp);
        // this.form.peclocalWater = this.NumberJudge(item.peclocalWater);
        // this.form.peclocalSed = this.NumberJudge(item.peclocalSed);
        // this.form.peclocalSoil30 = this.NumberJudge(item.peclocalSoil30);
        // this.form.peclocalGrw = this.NumberJudge(item.peclocalGrw);
        // this.form.pecaquPredator = this.NumberJudge(item.pecaquPredator);
        // this.form.pecterPredator = this.NumberJudge(item.pecterPredator);
        // this.form.addinh = this.NumberJudge(item.addinh);
        // this.form.addoralWater = this.NumberJudge(item.addoralWater);
        // this.form.addoralFood = this.NumberJudge(item.addoralFood);
        // this.form.addt = this.NumberJudge(item.addt);

        this.form.pecstpRcr = this.NumberJudge(item.pecstpRcr);
        this.form.peclocalWaterRcr = this.NumberJudge(item.peclocalWaterRcr);
        this.form.peclocalSedRcr = this.NumberJudge(item.peclocalSedRcr);
        this.form.peclocalSoil30Rcr = this.NumberJudge(item.peclocalSoil30Rcr);
        this.form.peclocalGrwRcr = this.NumberJudge(item.peclocalGrwRcr);
        this.form.pecaquPredatorRcr = this.NumberJudge(item.pecaquPredatorRcr);
        this.form.pecterPredatorRcr = this.NumberJudge(item.pecterPredatorRcr);
        this.form.addinhRcr = this.NumberJudge(item.addinhRcr);
        this.form.addoralWaterRcr = this.NumberJudge(item.addoralWaterRcr);
        this.form.addoralFoodRcr = this.NumberJudge(item.addoralFoodRcr);
        this.form.addtRcr = this.NumberJudge(item.addtRcr);

        this.temission_disabled = true;
        this.main_disabled = true;
        this.effluent_disabled = true;
        this.flow_disabled = true;
        this.fvariability_disabled = true;
        this.flocal_disabled = true;
        this.freg_disabled = true;
        this.fmain_disabled = true;
        this.fdirectwater_disabled = true;
        if(this.form.main !== 1){
          this.main_disabled = false;
        }
       if(this.form.fmain !== 0.1){
         this.fmain_disabled = false;
       }
       if(this.form.stpEffluent !== 2000){
         this.effluent_disabled = false;
       }
       if(this.form.flow !== 18000){
         this.flow_disabled = false;
       }
        if(this.form.fvariability !== 4){
          this.fvariability_disabled = false;
        }
       if(this.form.flocal !== 0.0005){
         this.flocal_disabled = false;
       }
       if(this.form.freg !== 0.1){
         this.freg_disabled = false;
       }
        if(this.form.fdirectwater !== 0.5){
          this.fdirectwater_disabled = false;
        }
        this.form.elocalDirectwater = this.NumberJudge(item.elocalDirectwater);
        this.form.elocalWater = this.NumberJudge(item.elocalWater);
        this.form.elocalstpAir = this.NumberJudge(item.elocalstpAir);
        this.form.elocalAir = this.NumberJudge(item.elocalAir);
        this.form.elocalstpWater = this.NumberJudge(item.elocalstpWater);
        this.form.elocalSoil = this.NumberJudge(item.elocalSoil);
        this.form.elocalstpSoil = this.NumberJudge(item.elocalstpSoil);

      },
      // 显示新增界面
      handleAdd: function () {
        this.editDialogVisible = true;
        this.operation = true;
        this.form.id = '';
        this.form.lifeCycle = '';
        this.form.title = '';
        this.form.remark = '';
      },
      submitForm() {
        if (this.form.lifeCycle !== '') {
          if (this.form.title !== '') {
            let scenes = Object.assign({
              cas: this.form.cas,
              lifeCycle: this.form.lifeCycle,
              title: this.form.title,
              remark: this.form.remark,
              temission: this.form.temission,
                waterTo: '0',
              /* emissionPattern: '2',
            main: 1,
            fmain: 0.1,
            freg: 0.1,
            fvariability: 4,
            fdirectwater: 0.5,
            stpEffluent: 2000,
            flow: 18000,
            flocal: 0.0005,*/
              stpWater: this.fstpWater,
              stpAir: this.fstpAir,
              stpSludge: this.fstpSludge,
              stpDegrade: this.fstpDegrade,
              stponsiteWater: this.fstpWater,
              stponsiteAir: this.fstpAir,
              stponsiteSludge: this.fstpSludge,
              stponsiteDegrade: this.fstpDegrade,
            });
            this.$confirm("确认添加新场景吗？", "提示", {}).then(() => {
              this.$api.output.save(scenes).then((res) => {
                if (res.code === 200) {
                  this.editDialogVisible = false;
                  this.$message({message: "添加成功", type: "success"});
                  this.$refs["form"].resetFields();
                  this.temission_disabled = true;
                  this.main_disabled = true;
                  this.effluent_disabled = true;
                  this.flow_disabled = true;
                  this.fvariability_disabled = true;
                  this.flocal_disabled = true;
                  this.freg_disabled = true;
                  this.fmain_disabled = true;
                  this.fdirectwater_disabled = true;
                  this.useSource = '';
                  this.getScenes(this.form.cas);
                  this.$store.commit('setFlag', !this.$store.getters.getFlag);
                } else {
                  this.$message({
                    message: "操作失败, " + res.msg,
                    type: "error",
                  });
                }
                // this.reload();
              });
            });
          }
        else {
          this.$message({message: "暴露场景短标题不能为空", type: "error"});
        }
      }else{
          this.$message({message: "请选择生命周期阶段", type: "error"});
        }
      },
      updateScenes(){
        if(this.form.lifeCycle !== '') {
          if (this.form.qchemical !== '') {
            let scenes = Object.assign({}, this.form);
            this.$confirm("确认修改吗？", "提示", {}).then(() => {
              this.$api.output.save(scenes).then((res) => {
                if (res.code === 200) {
                  this.$message({message: "修改成功", type: "success"});
                  let cas = {cas: this.form.cas}
                  this.$api.output.findByCas(cas).then((res) => {
                    if(res.data.length > 0){
                      this.isLife = false;
                      this.scenes = res.data;
                      console.log("this.maxIndex::::::",this.maxIndex)
                    }
                    else{
                      this.isLife = true;
                    }
                  })
                  this.$store.commit('setFlag', !this.$store.getters.getFlag);
                } else {
                  this.$message({
                    message: "修改失败, " + res.msg,
                    type: "error",
                  });
                }
                // this.reload();
              });
            });
          }else{
            this.$message({message: "年生产、使用或废物利用处理量不能为空", type: "error"});
          }
        }else{
          this.$message({message: "请选择生命周期阶段", type: "error"});
        }

      },
      deleteScenes(){
        let scenes = Object.assign({}, this.form);
        this.$confirm("确认删除吗？", "提示", {}).then(() => {
          this.$api.output.dele(scenes).then((res) => {
            if (res.code === 200) {
              this.$message({message: "删除成功", type: "success"});
              this.$refs["form"].resetFields();
              let cas = {cas:this.form.cas,};
              this.$api.output.findByCas(cas).then((res) => {
                if(res.data.length > 0){
                  this.isLife = false;
                  this.input_show = true;
                  this.isEmission = true;
                  this.scenes = res.data;
                  this.maxIndex = this.scenes.length-1 + '';
                  this.showScenes(this.scenes[this.scenes.length-1],this.scenes.length-1)
                }
                else if(res.data.length === 0){
                  this.form.lifeCycle = '',
                  this.isEmission = false;
                  this.input_show = false;
                  this.isLife = true;
                  this.scenes = res.data;
                }
                else{
                  this.form.lifeCycle = '',
                  this.input_show = false;
                  this.isEmission = false;
                  this.isLife = true;
                }
              });
              this.$store.commit('setFlag', !this.$store.getters.getFlag);
            } else {
              this.$message({
                message: "删除失败, " + res.msg,
                type: "error",
              });
            }

            // this.reload();
          });
        });
      },
        changeStandardstp(){
          if(this.form.emissionPattern === '1'){
              if(this.form.publicStp === '1'){
                  this.form.stpWater = this.fstpWater;
                  this.form.stpAir = this.fstpAir;
                  this.form.stpSludge = this.fstpSludge;
                  this.form.stpDegrade = this.fstpDegrade;
              }
              if(this.form.stponsite === '标准STP') {
                  this.form.stponsiteWater = this.fstpWater;
                  this.form.stponsiteAir = this.fstpAir;
                  this.form.stponsiteSludge = this.fstpSludge;
                  this.form.stponsiteDegrade = this.fstpDegrade;
              }
          }
            if(this.form.emissionPattern === '2') {
                if(this.form.publicStp === '1'){
                    this.form.stpWater = this.fstpWater2;
                    this.form.stpAir = this.fstpAir2;
                    this.form.stpSludge = this.fstpSludge2;
                    this.form.stpDegrade = this.fstpDegrade2;
                }
                if(this.form.stponsite === '标准STP') {
                    console.log("2---------标准----------:")
                    this.form.stponsiteWater = this.fstpWater2;
                    this.form.stponsiteAir = this.fstpAir2;
                    this.form.stponsiteSludge = this.fstpSludge2;
                    this.form.stponsiteDegrade = this.fstpDegrade2;
                }
            }
        },
      changeStp(){
        if(this.form.publicStp === '1'){
          if(this.form.emissionPattern === '1'){
            this.form.stpWater = this.fstpWater;
            this.form.stpAir = this.fstpAir;
            this.form.stpSludge = this.fstpSludge;
            this.form.stpDegrade = this.fstpDegrade;
          }
          if(this.form.emissionPattern === '2'){
            this.form.stpWater = this.fstpWater2;
            this.form.stpAir = this.fstpAir2;
            this.form.stpSludge = this.fstpSludge2;
            this.form.stpDegrade = this.fstpDegrade2;
          }
          this.stp_disabled = true;
        }
        if(this.form.publicStp === '2'){
          this.stp_disabled = false;
        }

      },
      showInput(){
        this.input_show = true;
        this.compute_disabled = false;
      },
      showResults(){
        this.input_show = false;
        this.compute_disabled = true;
      },
      changeQchmical(){
        this.qchemical_disabled = false;
      },
      changeTemission(){
        this.temission_disabled = !this.temission_disabled;
        if(this.temission_disabled){
          this.temissionTip = '修改';
          if(this.form.lifeCycle === '消费使用') {
            this.form.temission = 365;
          }
          else{
            this.form.temission = 20;
          }
        }
        else{
          if(this.form.lifeCycle === '消费使用'){
            this.temissionTip = '使用默认值365';
          }
          else{
            this.temissionTip = '使用默认值20';
          }
        }
      },

      changeFreg(){
        this.freg_disabled = !this.freg_disabled;
        if(this.freg_disabled){
          this.fregTip = '修改';
          this.form.freg = 0.1;
        }
        else{
          this.fregTip = '使用默认值0.1';
        }
      },
      changeFvariability(){

        this.fvariability_disabled = !this.fvariability_disabled;
        if(this.fvariability_disabled){
          this.fvariabilityTip = '修改';
          this.form.fvariability = 4;
        }
        else{
          this.fvariabilityTip = '使用默认值4';
        }
      },
      changeFdirectwater(){

        this.fdirectwater_disabled = !this.fdirectwater_disabled;
        if(this.fdirectwater_disabled){
          this.fdirectwaterTip = '修改';
          this.form.fdirectwater = 0.5;
        }
        else{
          this.fdirectwaterTip = '使用默认值0.5';
        }
      },
      changeMain(){
        this.main_disabled = !this.main_disabled;
        if(this.main_disabled){
          this.mainTip = '修改';
          this.form.main = 1;
        }
        else{
          this.mainTip = '使用默认值1';
        }
      },
      changeFmain(){
        this.fmain_disabled = !this.fmain_disabled;
        if(this.fmain_disabled){
          this.fmainTip = '修改';
          this.form.fmain = 0.1;
        }
        else{
          this.fmainTip = '使用默认值0.1';
        }
      },
      changeEffluent(){
        this.effluent_disabled = !this.effluent_disabled;
        if(this.effluent_disabled){
          this.effluentTip = '修改';
          this.form.stpEffluent = 2000;
        }
        else{
          this.effluentTip = '使用默认值2000';

        }
      },
      changeFlow(){
        this.flow_disabled = !this.flow_disabled;
        if(this.flow_disabled){
          this.flowTip = '修改';
          this.form.flow = 18000;
        }
        else{
          this.flowTip = '使用默认值18000';
        }
      },
      changeSludge(){
        if(this.form.waterTo === '2'){
          if(this.form.appLsludge === '2'){
            this.parameter.applSludge = 0;
          }
          if (this.form.appLsludge === '1') {
            this.parameter.applSludge = 0.75;
          }
        }
      },

      changeFlocal(){
        this.flocal_disabled = !this.flocal_disabled;
        if(this.flocal_disabled){
          this.flocalTip = '修改';
          this.form.flocal = 0.0005;
        }
        else{
          this.flocalTip = '使用默认值0.0005';
        }
      },

      setAbatementWater(){
        if(this.form.stponsite === '自行输入') {
          this.form.abatementWater = 1 - parseFloat(this.form.stponsiteWater);
          this.abatementWater_disabled = true;
        }
      },

      changeEmission(){
        if(this.form.lifeCycle === '消费使用'){
          this.form.temission = 365;
          this.isEmission = true;
          this.input_show = true;
          this.industrial_disabled = false;
          this.consume_disabled = true;
          this.waste_disabled = false;
          this.useSource = '消费源';

          this.form.stpWater = this.fstpWater;
          this.form.stpAir = this.fstpAir;
          this.form.stpSludge = this.fstpSludge;
          this.form.stpDegrade = this.fstpDegrade;

          this.form.stponsiteWater = this.fstpWater;
          this.form.stponsiteAir = this.fstpAir;
          this.form.stponsiteSludge = this.fstpSludge;
          this.form.stponsiteDegrade = this.fstpDegrade;

        }
        else if(this.form.lifeCycle === '废物利用处置'){
          this.form.temission = 20;
          this.isEmission = true;
          this.input_show = true;
          this.industrial_disabled = false;
          this.consume_disabled = false;
          this.waste_disabled = true;
          this.useSource = '废物处置利用源';
        }
        else if(this.form.lifeCycle === '生产' || this.form.lifeCycle === '配制' || this.form.lifeCycle === '工业使用'){
          this.form.temission = 20;
          this.isEmission = true;
          this.input_show = true;
          this.industrial_disabled = true;
          this.consume_disabled = false;
          this.waste_disabled = false;
          this.useSource = '工业源';
        }
      },

      stponsiteShow(){
        if(this.form.stponsite === '自行输入') {
          this.abatementWater_disabled = true;
          this.stponsite_disabled = true;
          this.isStponsite = true;
        }
        else if(this.form.stponsite === '标准STP') {
          this.abatementWater_disabled = true;
          this.stponsite_disabled = true;
          this.isStponsite = false;
          if(this.form.emissionPattern === '1'){
            this.form.stponsiteWater = this.fstpWater;
            this.form.stponsiteAir = this.fstpAir;
            this.form.stponsiteSludge = this.fstpSludge;
            this.form.stponsiteDegrade = this.fstpDegrade;
          }
          if(this.form.emissionPattern === '2') {
            this.form.stponsiteWater = this.fstpWater2;
            this.form.stponsiteAir = this.fstpAir2;
            this.form.stponsiteSludge = this.fstpSludge2;
            this.form.stponsiteDegrade = this.fstpDegrade2;
          }
        }
        else if(this.form.stponsite === '无'){
          this.stponsite_disabled = false;
          this.form.stponsiteWater = '1';
          this.form.stponsiteAir = '0';
          this.form.stponsiteSludge = '0';
          this.form.stponsiteDegrade = '0';
        }
       // console.log("this.form.stponsiteWater:",this.form.stponsiteWater);
        if(this.form.stponsiteWater !== ''){
          this.form.abatementWater = 1 - parseFloat(this.form.stponsiteWater);
        }
      },
      setOther(){
        if (this.form.waterTo === '1') {
          this.form.stpWater = '1';
          this.form.stpAir = '0';
          this.form.stpSludge = '0';
          this.form.stpDegrade = '0';
          // 污泥是否农用 2为否
          this.form.appLsludge = '2';
          this.isWaterto = false;
          this.parameter.applSludge = 0;
        }
        if(this.form.waterTo === '2'){
          this.form.appLsludge = '1';
          this.isWaterto = true;
          if(this.form.appLsludge === '2'){
            this.parameter.applSludge = 0;
          }
          if (this.form.appLsludge === '1') {
            this.form.stpWater = this.fstpWater;
            this.form.stpAir = this.fstpAir;
            this.form.stpSludge = this.fstpSludge;
            this.form.stpDegrade = this.fstpDegrade;
            this.parameter.applSludge = 0.75;
          }
        }
      },
      NumberJudge(para){
        let n = 0;
        if(para != null) {
          if (para < 0.001 && para != 0) {
            for (; para < 1;) {
              para = para * 10;
              n++;
            }
            para = Number(para.toPrecision(3));
            return (para + 'E-' + n);
          } else if (para > 0.001 && para < 100) {
            return (Number(para.toPrecision(3)));
          } else if (para > 100) {
            return (Number(para.toFixed(0)));
          } else if (para === 0) {
            return 0;
          }
        }
        else{
          return '';
        }
      },
      compute(){
        //工业源
        if(this.useSource === '工业源') {
          //公式计算
          if (this.form.waterTo === '1') {
            this.form.elocalWater = 0;
            this.form.elocalDirectwater = parseFloat(this.form.qchemical) * parseFloat(this.form.main) * parseFloat(this.form.water) * (1 - parseFloat(this.form.abatementWater)) / parseFloat(this.form.temission);
            this.form.elocalstpAir = 0;
            this.form.elocalstpWater = 0;
            this.form.elocalSoil = parseFloat(this.form.qchemical) * parseFloat(this.form.main) * parseFloat(this.form.sludge) * (1 - parseFloat(this.form.abatementSludge)) / parseFloat(this.form.temission);
            if(this.form.appLsludge === '1'){
              this.form.elocalstpSoil = parseFloat(this.form.elocalWater) * parseFloat(this.form.stpSludge);
            }
            else if(this.form.appLsludge === '2'){
              this.form.elocalstpSoil = 0;
            }
          } else {  //进入公共STP
            this.form.elocalWater = parseFloat(this.form.qchemical) * parseFloat(this.form.main) * parseFloat(this.form.water) * (1 - parseFloat(this.form.abatementWater)) / parseFloat(this.form.temission);
            this.form.elocalstpAir = parseFloat(this.form.elocalWater) * parseFloat(this.form.stpAir);
            this.form.elocalstpWater = parseFloat(this.form.elocalWater) * parseFloat(this.form.stpWater);
            this.form.elocalDirectwater = 0;
            this.form.elocalSoil = parseFloat(this.form.qchemical) * parseFloat(this.form.main) * parseFloat(this.form.sludge) * (1 - parseFloat(this.form.abatementSludge)) / parseFloat(this.form.temission);
            if(this.form.appLsludge === '1'){
              this.form.elocalstpSoil = parseFloat(this.form.elocalWater) * parseFloat(this.form.stpSludge);
            }
            else if(this.form.appLsludge === '2'){
              this.form.elocalstpSoil = 0;
            }
          }
          if(this.form.stponsite === '标准STP'){
            this.form.elocalAir = (parseFloat(this.form.qchemical) * parseFloat(this.form.main) * parseFloat(this.form.water) / parseFloat(this.form.temission)) * parseFloat(this.form.stponsiteAir) + (parseFloat(this.form.qchemical) * parseFloat(this.form.main) * parseFloat(this.form.air) / parseFloat(this.form.temission)) ;
          }
          else{
            this.form.elocalAir = parseFloat(this.form.qchemical) * parseFloat(this.form.main) * parseFloat(this.form.air) * (1 - parseFloat(this.form.abatementAir)) / parseFloat(this.form.temission) + parseFloat(this.form.elocalWater) * parseFloat(this.form.stponsiteAir);
          }
        }
        else if(this.useSource === '消费源'){
          this.form.elocalWater = parseFloat(this.form.qchemical) * parseFloat(this.form.freg) * parseFloat(this.form.flocal) * parseFloat(this.form.fvariability) * parseFloat(this.form.water) * (1-parseFloat(this.form.fdirectwater)) / parseFloat(this.form.temission);
          this.form.elocalstpAir = parseFloat(this.form.elocalWater) * parseFloat(this.form.stpAir);
          this.form.elocalAir = parseFloat(this.form.qchemical) * parseFloat(this.form.freg) * parseFloat(this.form.flocal) * parseFloat(this.form.fvariability) * parseFloat(this.form.air) / parseFloat(this.form.temission);
          this.form.elocalstpWater = parseFloat(this.form.elocalWater) * parseFloat(this.form.stpWater);
          this.form.elocalDirectwater = parseFloat(this.form.qchemical) * parseFloat(this.form.freg) * parseFloat(this.form.flocal) * parseFloat(this.form.fvariability) * parseFloat(this.form.water) * parseFloat(this.form.fdirectwater) / parseFloat(this.form.temission);
          this.form.elocalSoil = parseFloat(this.form.qchemical) * parseFloat(this.form.freg) * parseFloat(this.form.flocal) * parseFloat(this.form.fvariability) * parseFloat(this.form.sludge)  / parseFloat(this.form.temission);
          this.form.elocalstpSoil = parseFloat(this.form.elocalWater) * parseFloat(this.form.stpSludge);
        }
        else{
          if (this.form.waterTo === '1') {
            this.form.elocalWater = 0;
            this.form.elocalDirectwater = parseFloat(this.form.qchemical) * parseFloat(this.form.waste) * parseFloat(this.form.fmain) * parseFloat(this.form.water) * (1 - parseFloat(this.form.abatementWater)) / parseFloat(this.form.temission);
            this.form.elocalstpAir = 0;
            this.form.elocalstpWater = 0;
            this.form.elocalSoil = parseFloat(this.form.qchemical) * parseFloat(this.form.fmain) * parseFloat(this.form.sludge) * (1 - parseFloat(this.form.abatementSludge)) / parseFloat(this.form.temission);
            this.form.elocalstpSoil = parseFloat(this.form.elocalWater) * parseFloat(this.form.stpSludge);
          } else {  //进入公共STP
            this.form.elocalWater = parseFloat(this.form.qchemical) * parseFloat(this.form.waste) * parseFloat(this.form.fmain) * parseFloat(this.form.water) * (1 - parseFloat(this.form.abatementWater)) / parseFloat(this.form.temission);
            this.form.elocalstpAir = parseFloat(this.form.elocalWater) * parseFloat(this.form.stpAir);
            this.form.elocalstpWater = parseFloat(this.form.elocalWater) * parseFloat(this.form.stpWater);
            this.form.elocalDirectwater = 0;
            this.form.elocalSoil = parseFloat(this.form.qchemical) * parseFloat(this.form.waste) * parseFloat(this.form.fmain) * parseFloat(this.form.sludge) * (1 - parseFloat(this.form.abatementSludge)) / parseFloat(this.form.temission);
            if(this.form.appLsludge === '1'){
              this.form.elocalstpSoil = parseFloat(this.form.elocalWater) * parseFloat(this.form.stpSludge);
            }
            else if(this.form.appLsludge === '2'){
              this.form.elocalstpSoil = 0;
            }
          }
          if(this.form.stponsite === '标准STP'){
            this.form.elocalAir = (parseFloat(this.form.qchemical) * parseFloat(this.form.fmain) * parseFloat(this.form.water) / parseFloat(this.form.temission)) * parseFloat(this.form.stponsiteAir) + (parseFloat(this.form.qchemical) * parseFloat(this.form.fmain) * parseFloat(this.form.air) / parseFloat(this.form.temission)) ;
          }
          else{
            this.form.elocalAir = parseFloat(this.form.qchemical) * parseFloat(this.form.fmain) * parseFloat(this.form.air) * (1 - parseFloat(this.form.abatementAir)) / parseFloat(this.form.temission);
          }
        }
        if(isNaN(this.form.elocalAir)){
          this.form.elocalAir = 0;
        }
        if(isNaN(this.form.elocalstpAir)){
          this.form.elocalstpAir = 0;
        }
        if(isNaN(this.form.elocalWater)){
          this.form.elocalWater = 0;
        }
        if(isNaN(this.form.elocalstpWater)){
          this.form.elocalstpWater = 0;
        }
        if(isNaN(this.form.elocalstpWater)){
          this.form.elocalstpWater = 0;
        }
        if(isNaN(this.form.elocalSoil)){
          this.form.elocalSoil = 0;
        }
        if(isNaN(this.form.elocalstpSoil)){
          this.form.elocalstpSoil = 0;
        }

        this.Totalcomputes();


      },
      Totalcomputes() {

        this.compute_PECstp();
        this.compute_PEClocalwater();
        this.compute_PEClocalsed();

        this.compute_PEClocalsoli30();
        this.compute_PEClocalgrw();
        this.compute_PECaquPredator();
        this.compute_PECterPredator();

        this.compute_ADDinh();
        this.compute_ADDoralWater();
        this.compute_ADDoralFood();
        this.compute_ADDT();

        this.compute_EnvirmentRcr();
        this.compute_HealthRcr();

         /* let emissionsResult = Object.assign({}, this.form);
          this.$api.output.save(emissionsResult).then((res) => {
              if (res.code === 200) {
                 /!* this.compute_disabled = true;*!/
                  let cas = {cas: this.form.cas}
                  this.$api.output.findByCas(cas).then((res) => {
                      if(res.data.length > 0){
                          this.isLife = false;
                          this.scenes = res.data;
                          if(this.$store.getters.getId !== ''){
                              this.maxIndex = this.$store.getters.getId + '';
                              this.showScenes(this.scenes[this.$store.getters.getId],this.$store.getters.getId);
                          }
                          else{
                              this.maxIndex = this.scenes.length-1 + '';
                              this.showScenes(this.scenes[this.scenes.length-1],this.scenes.length-1);
                          }
                      }
                      else{
                          this.isLife = true;
                      }
                  })
                  this.$store.commit('setFlag', !this.$store.getters.getFlag);
              }
          })*/
        this.form.elocalWater = this.NumberJudge(this.form.elocalWater);
        this.form.elocalstpWater = this.NumberJudge(this.form.elocalstpWater);
        this.form.elocalstpAir = this.NumberJudge(this.form.elocalstpAir);
        this.form.elocalAir = this.NumberJudge(this.form.elocalAir);
        this.form.elocalSoil = this.NumberJudge(this.form.elocalSoil);
        this.form.elocalstpSoil = this.NumberJudge(this.form.elocalstpSoil);
        this.form.elocalDirectwater = this.NumberJudge(this.form.elocalDirectwater);
      },
      compute_PECstp() {

        if(this.form.lifeCycle === '生产' || this.form.lifeCycle === '配制' || this.form.lifeCycle === '工业使用' || this.form.lifeCycle === '废物利用处置'){
          if(this.form.waterTo === '1'){
            this.form.pecstp = this.form.elocalDirectwater * 1000 / this.parameter.effluentStp;
            this.pecstpTip = '企业自有STP PEC';
          }
          if(this.form.waterTo === '2'){
            this.form.pecstp = this.form.elocalWater*1000000*this.density.fstpWater/(this.parameter.effluentStp*1000);
            this.pecstpTip = '集中式STP PEC';
          }
        }
        if(this.form.lifeCycle === '消费使用'){
          this.form.pecstp = this.form.elocalWater*1000000*this.density.fstpWater/(this.parameter.effluentStp*1000);
        }
        // console.log("pecstpppppppppppppppppp")
        // console.log(this.form.elocalWater);
        // console.log(this.density.fstpWater);
        // console.log(this.parameter.effluentStp);

        this.form.pecstp = this.NumberJudge(this.form.pecstp);


      },
        compute_PEClocalwater() {

            if(this.form.elocalWater==null) this.form.elocalWater=9.99;
            if(this.density.fstpWater==null) this.density.fstpWater=0.061;
            if(this.parameter.effluentStp==null) this.parameter.effluentStp=2000;
            if(this.parameter.flow==null) this.parameter.flow=18000;
            if(this.density.kpSusp==null) this.density.kpSusp=2.05;
            if(this.parameter.suspWater==null)  this.parameter.suspWater=15;
            if(this.parameter.focSusp==null)   this.parameter.focSusp=0.1;
            if(this.density.koc==null) this.density.koc=205;
            this.density.kpSusp=this.parameter.focSusp*this.density.koc;
            this.density.clocalWater =
                (this.form.elocalWater * this.density.fstpWater*1000)/
                ((this.parameter.effluentStp + this.parameter.flow)* (1+this.density.kpSusp*this.parameter.suspWater/1000000));
            //1.2计算  Clocal.directwater=Elocal.directwater*1000/(FLOW*(1+Kp.susp*SUSPwater/10^6))
            if(this.parameter.flow==null) this.parameter.flow=18000;
            //if(this.density.kpSusp==null) this.kpSusp=21;
            if(this.parameter.suspWater==null) this.parameter.suspWater=15;
            this.density.clocalDirectwater =
                (this.form.elocalDirectwater*1000)/(this.parameter.flow*(1+this.density.kpSusp*this.parameter.suspWater/10000000));
            //1.3计算 PECreg.water
            if(this.density.pecregWater == null){
                this.density.pecregWater = 0;
            }
            this.form.peclocalWater= this.density.clocalWater + this.density.clocalDirectwater + this.density.pecregWater;
            this.form.peclocalWater = this.NumberJudge(this.form.peclocalWater);
        },
      compute_PEClocalsed() {

        if(this.parameter.fwaterSusp==null) this.parameter.fwaterSusp=0.9;
        if(this.parameter.fsoildSusp==null)this.parameter.fsoildSusp=0.1;
        if(this.parameter.focSusp==null)   this.parameter.focSusp=0.1;
        if(this.density.koc==null) this.density.koc=205;
        this.density.kpSusp=this.parameter.focSusp*this.density.koc;
        if(this.parameter.rhoSolid==null)this.parameter.rhoSolid=2500;
        this.density.ksuspWater=this.parameter.fwaterSusp+this.parameter.fsoildSusp*this.density.kpSusp*this.parameter.rhoSolid/1000;
        if(this.parameter.fsoildSed==null) this.parameter.fsoildSed=0.2;
        if(this.parameter.rhoSolid==null) this.parameter.rhoSolid=2500;
        if(this.parameter.fwaterSed==null)this.parameter.fwaterSed=0.8;
        if(this.parameter.rhoWater==null) this.parameter.rhoWater=1000;
        this.parameter.rhoSed=(this.parameter.fsoildSed*this.parameter.rhoSolid+this.parameter.fwaterSed*this.parameter.rhoWater);
        this.parameter.convSed=this.parameter.rhoSed/(this.parameter.fsoildSed*this.parameter.rhoSolid);
        if(this.parameter.fsoildSusp==null) this.parameter.fsoildSusp=0.1;
        if(this.parameter.fwaterSusp==null) this.parameter.fwaterSusp=0.9;
        this.parameter.rhoSusp=(this.parameter.fsoildSusp*this.parameter.rhoSolid+this.parameter.fwaterSusp*this.parameter.rhoWater);
        let result3 =this.density.ksuspWater*this.form.peclocalWater*1000*this.parameter.convSed/this.parameter.rhoSusp;
        this.form.peclocalSed =this.NumberJudge(result3);


      },
        compute_PEClocalsoli30() {

            if(this.density.fstpAir==null)  this.density.fstpAir=0.211;
            if(this.parameter.temp==null) this.parameter.temp=289;
            // this.density.vp=this.density.vpTemptest*Math.exp((50000/8.314)*(1/this.density.tempVptest-1/289));
            //this.density.vpl=this.density.vp/Math.exp(6.79*(1-this.density.tempmelt/this.parameter.temp));

            if(this.density.depstdAer==null) this.density.depstdAer=0.01;
            // this.density.sol=this.density.solTemptest*Math.exp((10000/8.314)*(1/this.density.tempSoltest-1/10));
           // this.density.henry=this.density.vp*this.density.molw/this.density.sol;


            if(Math.log10(this.density.henry)<-2){
                this.density.depstdGas=0.0005;
            }
            else if(Math.log10(this.density.henry)>2){
                this.density.depstdGas=0.0003;
            }
            else{
                this.density.depstdGas=0.0004;
            }

          // deptotal =(Elocal.air+ElocalSTP.air)*(Fass.aer*DEPstd.aer+(1-Fass_aer)*DEPstd.gas)
            this.density.deptotal=(Number(this.form.elocalAir)+Number(this.form.elocalstpAir))*(Number(this.density.fassAer)*Number(this.density.depstdAer)+(1-Number(this.density.fassAer))*Number(this.density.depstdGas));
           // console.log("this.density.fassAer",this.density.fassAer);

            // console.log("this.density.elocalAir",this.form.elocalAir);
            // console.log("this.density.elocalstpAir",this.form.elocalstpAir);
            // console.log("this.density.depstdAer",this.density.depstdAer);
            // console.log("this.density.depstdGas",this.density.depstdGas);

            //console.log("@@@@@@@@@@@@deptotal",this.density.deptotal);

            // this.density.vpl=this.density.vp/Math.exp(6.79*(1-this.density.tempVptest/this.parameter.temp));


            //this.density.temission=this.form.temission;
           this.density.deptotalAnn=this.density.deptotal*this.form.temission/365;

             console.log("temission",this.form.temission);
            //this.density.deptotalAnn=this.density.deptotal*this.form.elocalstpAir/365;

            if(this.parameter.DEPTHsoil==null) this.parameter.DEPTHsoil=0.2;

            if(this.parameter.fsolidSoil==null) this.parameter.fsolidSoil=0.6;
            if(this.parameter.rhoSolid==null)this.parameter.rhoSolid=2500;
            if(this.parameter.fwaterSoil==null) this.parameter.fwaterSoil=0.2;
            if(this.parameter.fairSoil==null) this.parameter.fairSoil=0.2;
            if(this.parameter.rhoAir==null) this.parameter.rhoAir=1.3;
            this.parameter.rhoSoil=(this.parameter.fsolidSoil*this.parameter.rhoSolid)+(this.parameter.fwaterSoil*this.parameter.rhoWater)+(this.parameter.fairSoil*this.parameter.rhoAir);
            this.density.dair=this.density.deptotalAnn/(this.parameter.DEPTHsoil*this.parameter.rhoSoil);

            this.density.corrVolatS=(1/0.1)*this.parameter.DEPTHsoil/(1-Math.exp(-1/0.1*this.parameter.DEPTHsoil));
            if(this.parameter.fairSoil==null) this.parameter.fairSoil=0.2;
            //this.density.kairWater=Number(this.density.henry)/8.314/Number(this.parameter.temp);
            if(this.parameter.fwaterSoil==null) this.parameter.fwaterSoil=0.2;
            if(this.parameter.fsolidSoil==null) this.parameter.fsolidSoil=0.6;
            if(this.parameter.focSoil==null) this.parameter.focSoil=0.02;
            this.density.kpSoil=this.parameter.focSoil*this.density.koc;
            // console.log("this.density.kpSoil", this.density.kpSoil);

            if(this.parameter.rhoSolid==null) this.parameter.rhoSolid=2500;
            this.density.ksoilWater=this.parameter.fairSoil*this.density.kairWater+this.parameter.fwaterSoil+this.parameter.fsolidSoil*this.density.kpSoil*this.parameter.rhoSolid/1000;
            if(this.density.kaslAir==null) this.density.kaslAir=90.53;

            // if (this.density.biodeg === "1") {
            //     if (this.density.kpSoil <= 100) {
            //         this.density.kbioSoil = Math.LN2 / 30;
            //     } else if (this.density.kpSoil>100 && this.density.kpSoil <= 1000) {
            //         this.density.kbioSoil = Math.LN2 / 300;
            //     } else if (this.density.kpSoil>1000 && this.density.kpSoil <= 10000) {
            //         this.density.kbioSoil = Math.LN2 / 3000;
            //     } else {
            //         this.density.kbioSoil = Math.LN2 / 30000;
            //     }
            // } else if (this.density.biodeg === "0.3") {
            //     if (this.density.kpSoil <= 100) {
            //         this.density.kbioSoil = Math.LN2 / 90;
            //     } else if (this.density.kpSoil>100 && this.density.kpSoil <= 1000) {
            //         this.density.kbioSoil = Math.LN2 / 900;
            //     } else if (this.density.kpSoil>1000 && this.density.kpSoil <= 10000) {
            //         this.density.kbioSoil = Math.LN2 / 9000;
            //     } else {
            //         this.density.kbioSoil = Math.LN2 / 90000;
            //     }
            // } else {
            //     if(this.density.biodeg==="0.1"||this.density.biodeg==="0.03 "){
            //         if(this.density.kpSoil <= 100){
            //             this.density.kbioSoil = Math.LN2 / 300;
            //         }else if(this.density.kpSoil <= 1000){
            //             this.density.kbioSoil = Math.LN2 / 3000;
            //         }else if(this.density.kpSoil <= 10000){
            //             this.density.kbioSoil = Math.LN2 / 30000;
            //         }else{
            //             this.density.kbioSoil = Math.LN2 / 300000;
            //         }
            //     }else{
            //         this.density.kbioSoil = Math.LN2 / 1000000;
            //     }
            // }

            this.density.kaslSoil=0.1*this.density.kbioSoil;
            //kvolat=CorrVolat.s*1/((Ksoil_water/(kasl.air*Kair_water)+1/kasl.soil)*DEPTHsoil)
            this.density.kvolat=this.density.corrVolatS*1/((this.density.ksoilWater/(this.density.kaslAir*this.density.kairWater)+1/this.density.kaslSoil)*this.parameter.DEPTHsoil);

            if(this.density.finfSoil==null) this.density.finfSoil=0.25;
            if(this.parameter.rainRate==null) this.parameter.rainRate=700/1000/365;
            this.density.kleach=this.density.finfSoil*(this.parameter.rainRate/1000/365)/this.density.ksoilWater/this.parameter.DEPTHsoil;

            // console.log("finfSoil",this.density.finfSoil);
            // console.log("rainRate",this.parameter.rainRate);
            // console.log("ksoilWater",this.density.ksoilWater);
            // console.log("DEPTHsoil",this.parameter.DEPTHsoil);
            //ksoil==kvolat+kleach+kbio.soil

            this.density.kSoil=this.density.kvolat+this.density.kleach+this.density.kbioSoil;
            console.log("kvolat",this.density.kvolat);
            console.log("kleach",this.density.kleach);
            console.log("kbioSoil",this.density.kbioSoil);

            // this.density.kSoil=0.0303;
            if(this.density.tavSoil==null) this.density.tavSoil=30;
            this.density.cdepSoilFive0=this.density.dair/this.density.kSoil-this.density.dair/this.density.kSoil*Math.exp(-365*5*this.density.kSoil);
            if(this.density.fstpSludge==null) this.density.fstpSludge=0.005;
            if(this.density.sludgerate==null) this.density.sludgerate=499;
            this.density.csludge=this.density.fstpSludge*this.form.elocalWater*1000000/this.density.sludgerate;
            if(this.parameter.applSludge==null) this.parameter.applSludge=0.75;
            if(this.parameter.DEPTHsoil==null) this.parameter.DEPTHsoil=0.2;
            this.density.csludgeSoilOne0=this.density.csludge*this.parameter.applSludge/(this.parameter.DEPTHsoil*this.parameter.rhoSoil);
            this.density.facc=Math.exp(-365*this.density.kSoil);
            this.density.csludgeSoilFive0=this.density.csludgeSoilOne0*(1+Math.pow(this.density.facc,1)+Math.pow(this.density.facc,2)+Math.pow(this.density.facc,3)+Math.pow(this.density.facc,4));
            this.density.csoilFive0=this.density.cdepSoilFive0+this.density.csludgeSoilFive0;

            //Clocal.soil(30)=Dair/k.soil+1/k.soil/Tav.soil*(Csoil5_0-Dair/k.soil)*(1-EXP(-1*k.soil*Tav.soil))
            this.density.clocalSoil30=this.density.dair/this.density.kSoil+1/this.density.kSoil/ this.density.tavSoil*(this.density.csoilFive0-this.density.dair/this.density.kSoil)*(1-Math.exp(-1*this.density.kSoil*this.density.tavSoil));
            console.log("******dair",this.density.dair);
            console.log("******kSoil",this.density.kSoil);
            console.log("******tavSoil",this.density.tavSoil);
            console.log("******csoilFive0",this.density.csoilFive0);

            if(this.density.pecregSoil==null) this.density.pecregSoil=0;
            if(this.parameter.rhoSolid==null) this.parameter.rhoSolid=2500;
            if(this.parameter.rhoWater==null) this.parameter.rhoWater=1000;
            if(this.parameter.rhoAir==null) this.parameter.rhoAir=1.3;
            if(this.parameter.fsolidSoil==null) this.parameter.fsolidSoil=0.6;
            if(this.parameter.fwaterSoil==null) this.parameter.fwaterSoil=0.2;
            if(this.parameter.fairSoil==null) this.parameter.fairSoil=0.2;
            if(this.density.fstpAir==null) this.density.fstpAir=0.21;
            this.parameter.rhoSoil=(this.parameter.fsolidSoil*this.parameter.rhoSolid+ this.parameter.fwaterSoil*this.parameter.rhoWater+this.parameter.fairSoil*this.parameter.rhoAir)
            this.parameter.convSoil = (this.parameter.rhoSoil/(this.parameter.fsolidSoil*this.parameter.rhoSolid)).toFixed(7);


            this.form.peclocalSoil30= (parseFloat(this.density.clocalSoil30)+parseFloat(this.density.pecregSoil))*parseFloat(this.parameter.convSoil);
            console.log("clocalSoil30",this.density.clocalSoil30);
            console.log("pecregSoil",this.density.pecregSoil);
            console.log("convSoil",this.parameter.convSoil);

            this.form.peclocalSoil30=this.NumberJudge(this.form.peclocalSoil30);

        },
        compute_PEClocalgrw() {
            if(this.parameter.DEPTHsoil==null) this.parameter.DEPTHsoil=0.2;
            if(this.density.fstpWater==null) this.density.fstpWater=0.061;
            if(this.parameter.effluentStp==null) this.parameter.effluentStp=2000;
            if(this.parameter.flow==null) this.parameter.flow=18000;
            if(this.parameter.suspWater==null) this.parameter.suspWater=15;
            this.density.clocalWater=this.parameter.DEPTHsoil*this.density.fstpWater*1000/
                (this.parameter.effluentStp+this.parameter.flow)*(1+this.density.kpSusp*this.parameter.suspWater/1000000);
            if(this.density.kpSusp==null) this.density.kpSusp=21;
            if(this.parameter.focSusp==null) this.parameter.focSusp=0.1;
            if(this.density.koc==null) this.density.koc=205;
            this.density.clocalDirectwater =this.form.elocalDirectwater*1000/
                (this.parameter.flow*(1+this.density.suspWater)*this.parameter.suspWater/1000000);
            if(this.density.pecregWater == null) this.density.pecregWater = 0;

            this.density.PEClocalwater_ann=this.form.peclocalWater*this.form.temission/365;

            if(this.density.fwaterSusp==null) this.parameter.fwaterSusp=0.9;
            if(this.parameter.rhoSolid==null) this.parameter.rhoSolid=2500;
            if(this.parameter.rhoWater==null) this.parameter.rhoWater=1000;
            if(this.parameter.rhoAir==null) this.parameter.rhoAir=1.3;
            if(this.parameter.fsolidSoil==null) this.parameter.fsolidSoil=0.6;
            if(this.parameter.fwaterSoil==null) this.parameter.fwaterSoil=0.2;
            if(this.parameter.fairSoil==null) this.parameter.fairSoil=0.2;

            if(this.density.fstpAir==null) this.density.fstpAir=0.211;
            this.parameter.rhoSoil=(this.parameter.fsolidSoil*this.parameter.rhoSolid+
                this.parameter.fwaterSoil*this.parameter.rhoWater+this.parameter.fairSoil*this.parameter.rhoAir)
            if(this.density.vpTemptest==null) this.density.vpTemptest=3089;
            if(this.density.tempmelt==null) this.density.tempmelt=-25.2;
            if(this.parameter.temp==null) this.parameter.temp= 10;
            if(this.density.depstdAer==null) this.density.depstdAer=0.01;
            if(this.density.tempSoltest==null) this.density.tempSoltest=25.00;
            if(this.density.solTempTest==null) this.density.solTempTest=587.00;
            if(this.density.molw==null) this.density.molw=92;
            if(this.density.tempVptest==null) this.density.tempVptest=21.1;
            /**
             * 下面这两个公式temp取10
             * sol=(Sol.TempTest)*EXP((10000/8.314)*(1/TEMP.SolTest-1/TEMP))
             * vp==Vp.temptest*EXP((50000/8.314)*(1/TEMP.Vptest-1/TEMP))
             * @type {number}
             */
            // this.density.sol=(this.density.solTempTest)*Math.exp((10000/8.314)*(1/this.density.tempSoltest-1/10));
            // this.density.vp=this.density.vpTemptest*Math.exp((50000/8.314)*(1/this.density.tempVptest-1/10));

            if(Math.log10(this.density.henry)<-2)
                this.density.depstdGas=0.0005;
            else if (Math.log10(this.density.henry)>2)
                this.density.depstdGas=0.0003;
            else {this.density.depstdGas=0.0004;}

           // this.density.vpl=this.density.vp/Math.exp(6.79*(1-this.density.tempmelt/this.parameter.temp));
            // this.density.fassAer=0.0001/(this.density.vpl+0.0001);

            // this.density.deptotal=(this.form.elocalAir+this.form.elocalstpAir)*
            //     (this.density.fassAer*this.density.depstdAer+(1-this.density.fassAer)*this.density.depstdGas);

            // console.log("deptotal",this.density.deptotal);    *******

            if(this.parameter.focSoil==null) this.parameter.focSoil=0.02;
            if(this.density.koc==null) this.density.koc=205.00;
            if(this.density.kaslAir==null) this.density.kaslAir=90.53;


            this.density.kaslSoil=0.1*this.density.kbioSoil;

            // console.log("##########ksoil", this.density.csludge);

            // this.density.kvolat=this.density.corrVolatS*1/((this.density.ksoilWater/
            //     (this.density.kaslAir*this.density.kairWater)+1/this.density.kaslSoil)*this.parameter.DEPTHsoil);
            if(this.density.finfSoil==null) this.density.finfSoil=0.25;
            if(this.parameter.rainRate==null) this.parameter.rainRate=0.001847;

            // this.density.kleach=this.density.finfSoil*this.parameter.rainRate/this.density.ksoilWater/this.parameter.DEPTHsoil;
            //   console.log("##########kleach",  this.density.kleach);


            this.density.cdepSoilTen0 =this.density.dair/this.density.kSoil-this.density.dair/this.density.kSoil*Math.exp(-365*10*this.density.kSoil);

            if(this.density.sludgerate==null) this.density.sludgerate=499;

            if(this.parameter.applSludge==null) this.parameter.applSludge=0.75;
            if(this.density.fstpSludge==null) this.density.fstpSludge=0.005;
            this.density.csludge=this.density.fstpSludge*this.form.elocalWater*1000000/this.density.sludgerate;
            this.density.csludgeSoilTen0 =this.density.csludge*this.parameter.applSludge/(this.parameter.DEPTHsoil*this.parameter.rhoSoil);
            //this.density.csoilTen0 =this.density.cdepSoilTen0+this.density.csludgeSoilTen0 ;
            //原公式             Clocal.soil_180=Dair/k.soil+1/k.soil/180*(Csoil10_0-Dair/k.soil)*(1-EXP(-1*k.soil*180))
            //   this.density.peclocalSoil180= this.density.dair/this.density.kSoil+1/this.density.kSoil/
            //       180*(this.density.csoilTen0-this.density.dair/this.density.kSoil)*(1-Math.exp(-1*this.density.kSoil*180));


            //2021.1.10  公式更新Clocal.soil_180=Dair/k.soil+1/k.soil/180*(Csoil5_0-Dair/k.soil)*(1-EXP(-1*k.soil*180))
            //this.density.dair=0.000097;
            this.density.csoilFive0=this.density.cdepSoilFive0+this.density.csludgeSoilFive0 ;
            this.density.peclocalSoil180= this.density.dair/this.density.kSoil+1/this.density.kSoil/
                180*(this.density.csoilFive0-this.density.dair/this.density.kSoil)*(1-Math.exp(-1*this.density.kSoil*180));
            //this.density.dair=this.density.deptotalAnn/(this.parameter.DEPTHsoil*this.parameter.rhoSoil);
            //  Dair    DEPtatal   重点校验
            console.log("##########deptotalAnn",this.density.deptotalAnn);


            if(1 == this.density.biodeg)
            {
                this.density.kbioFresh =  Math.LN2/15;
            }else if(2 == this.density.biodeg)
            {
                this.density.kbioFresh = Math.LN2/15;
            }
            else if(3 == this.density.biodeg)
            {
                this.density.kbioFresh =  Math.LN2/50;
            }
            else if(4 == this.density.biodeg)
            {
                this.density.kbioFresh =  Math.LN2/150;
            }
            else if(5 == this.density.biodeg)
            {
                this.density.kbioFresh =  Math.LN2/150;
            }
            else this.density.kbioFresh = Math.E-20;

            var  fpur_one;
            var  fpur_sec;
            if(Math.log10(this.density.kow)<=4)
            {
                fpur_one = 1;
            }else {
                var a;
                var b;
                if(Math.log10(this.density.kow)>5)
                {
                    a = 1/16;
                }else {
                    a = 1/4
                }

                if(this.density.henry <= 100)
                {
                    b = 1;
                }else {
                    b = 0.5;
                }
                fpur_one = a * b;

            }

            if(Math.log10(this.density.kow)<=4)
            {
                fpur_sec = 1;
            }else {
                var a;
                var b;
                var c;
                if(Math.log10(this.density.kow)>5)
                {
                    a = 1/4;
                }else {
                    a = 1/2;
                }

                if(this.density.henry <= 100)
                {
                    b = 1;
                }else {
                    b = 0.5;
                }

                if(Math.LN2*this.density.kbioFresh  <= 10)
                {
                    c = 1/4;
                }else {
                    c = 1;
                }
                fpur_sec = a * b * c;

            }
            this.density.fPur = Math.max(fpur_one,fpur_sec);

            if(this.parameter.irWater==null) this.parameter.irWater=1.85;
            if(this.parameter.ef==null) this.parameter.ef=365;
            if(this.parameter.ed==null) this.parameter.ed=70;
            if(this.parameter.bw==null) this.parameter.bw=60.6;
            if(this.parameter.at==null) this.parameter.at=25550;
            //this.density.peclocalSoil180=0.00194;

            this.form.peclocalGrw=this.density.peclocalSoil180*this.parameter.rhoSoil/this.density.ksoilWater/1000;

            // console.log("peclocalSoil180%%%%%%%",this.density.peclocalSoil180);    重点核验！！

            this.form.peclocalGrw = this.NumberJudge(this.form.peclocalGrw);

        },
      compute_PECaquPredator() {
          //=0.5*(PEClocal.water_ann+PECreg.water)*BCF.fish*BMF.1
        this.density.peclocalWaterAnn= this.form.peclocalWater * this.form.temission/365;
        if(this.density.pecregWater == null){
          this.density.pecregWater = 0;
        }
          var k = this.density.kow;
        // //计算1.3 BCF.fish
        // if(this.density.kow == null){
        //   this.density.kow = 537.0317964
        // }
        // var data;
        // if(Math.log10(k)<1){
        //   data = 0.00141;
        // }
        // else if (Math.log10(k)>10){
        //   data =0.479;
        // }
        // else if (Math.log10(k)<=6){
        //   var m = 0.85*Math.log10(k)-3.7;
        //   data = Math.pow(10,m);
        // }else {
        //   var m = -0.2*(Math.log10(k)*Math.log10(k)) + 2.74 * Math.log10(k) - 7.72;
        //   data = Math.pow(10,m);
        // }
        // data = 1000*data;
        // this.density.bcfFish = data;

        //计算1.4 BMF.1
        if(Math.log10(k) < 4.5){
          this.density.bmf1 = 1;
        }else {

          if (Math.log10(k) > 9) {
            this.density.bmf1 = 1;
          } else {
            if (Math.log10(k) < 5) {
              this.density.bmf1 = 5;
            } else {
              if (Math.log10(k) <= 8) {
                this.density.bmf1 = 10;
              } else {
                this.density.bmf1 = 3;
              }
            }

          }
        }

        console.log("peclocalWaterAnn", this.density.peclocalWaterAnn);
          console.log("pecregWater", this.density.pecregWater);
        this.form.pecaquPredator = 0.5 * (this.density.peclocalWaterAnn+this.density.pecregWater)*this.density.bcfFish *this.density.bmf1;

        this.form.pecaquPredator = this.NumberJudge(this.form.pecaquPredator);
      },
      compute_PECterPredator() {

        if(this.parameter.rhoWorm == null){
          this.parameter.rhoWorm = 1;
        }
        this.density.bcfWorm = (0.84+0.012*this.density.kow)/this.parameter.rhoWorm;
        this.density.peclocalSoilPorew = this.density.peclocalSoil180*
          this.parameter.rhoSoil/this.density.ksoilWater/1000;
        if(this.parameter.fgutWorm == null)
        {
          this.parameter.fgutWorm = 0.1;
        }

        this.form.pecterPredator = (0.5*
          (this.density.peclocalSoilPorew+this.density.pecregSoilPorew)
          *this.density.bcfWorm+
          0.5*(this.density.peclocalSoil180+this.density.pecregSoil)
          *this.parameter.fgutWorm* this.parameter.convSoil)/
          (1+this.parameter.fgutWorm*this.parameter.convSoil);
        this.form.pecterPredator = this.NumberJudge(this.form.pecterPredator);

      },
      compute_ADDinh(){
         //ADDinh=PEClocal.air_ann*IRair*ET*EF*ED/(BW*AT)
          if (this.density.cstdAir == null) this.density.cstdAir=0.000278;      //常数

        // if(this.density.fstpAir==null) this.density.fstpAir=0.211;
        // if(this.density.pecregAir == null) this.density.pecregAir = 0;
        //peclocalAirAnn=MAX(Elocal.air,ElocalSTP.air)*Cstd.air*Temission/365+PECreg.air
        this.density.peclocalAirAnn =Math.max(Number(this.form.elocalAir),Number(this.form.elocalstpAir))* this.density.cstdAir*this.form.temission/365+this.density.pecregAir;

        this.form.addinh = this.density.peclocalAirAnn*this.parameter.irAir*this.parameter.et*this.parameter.ef*this.parameter.ed/(this.parameter.bw*this.parameter.at);

        this.form.addinh = this.NumberJudge(this.form.addinh);
      },
      compute_ADDoralWater() {

        if(1 == this.density.biodeg)
        {
          this.density.kbioFresh =  Math.LN2/15;
        }else if(2 == this.density.biodeg)
        {
          this.density.kbioFresh =  Math.LN2/15;
        }
        else if(3 == this.density.biodeg)
        {
          this.density.kbioFresh =  Math.LN2/50;
        }
        else if(4 == this.density.biodeg)
        {
          this.density.kbioFresh =  Math.LN2/150;
        }
        else if(5 == this.density.biodeg)
        {
          this.density.kbioFresh =  Math.LN2/150;
        }
        else this.density.kbioFresh = Math.E-20;

        // 1

        let  fpur_one;
        let  fpur_sec;
        if(Math.log10(this.density.kow)<=4)
        {
          fpur_one = 1;
        }else {
          var a;
          var b;
          if(Math.log10(this.density.kow)>5)
          {
            a = 1/16;
          }else {
            a = 1/4
          }

          if(this.density.henry <= 100)
          {
            b = 1;
          }else {
            b = 0.5;
          }
          fpur_one = a * b;

        }

        if(Math.log10(this.density.kow)<=4)
        {
          fpur_sec = 1;
        }else {
          var a;
          var b;
          var c;
          if(Math.log10(this.density.kow)>5)
          {
            a = 1/4;
          }else {
            a = 1/2;
          }

          if(this.density.henry <= 100)
          {
            b = 1;
          }else {
            b = 0.5;
          }

          if(Math.LN2*this.density.kbioFresh  <= 10)
          {
            c = 1/4;
          }else {
            c = 1;
          }
          fpur_sec = a * b * c;

        }
        //this.density.fPur = Math.max(fpur_one,fpur_sec)
        this.density.fPur =1;     //density 表  fpur=1
        //console.log("Result_fPur:",this.density.fPur);

        if(this.parameter.irWater==null) this.parameter.irWater=1.85;
        if(this.parameter.ef==null) this.parameter.ef=365;
        if(this.parameter.ed==null) this.parameter.ed=70;
        if(this.parameter.bw==null) this.parameter.bw=60.6;
        if(this.parameter.at==null) this.parameter.at=25550;

        this.form.addoralWater=Math.max(this.density.PEClocalwater_ann*this.density.fPur,this.form.peclocalGrw)
          *this.parameter.irWater*this.parameter.ef*this.parameter.ed/(this.parameter.bw*this.parameter.at);

        this.form.addoralWater = this.NumberJudge(this.form.addoralWater);
      },
      compute_ADDoralFood() {

        this.density.PEClocalwater_ann=this.form.peclocalWater*this.form.temission/365;

        if(this.density.bcfFish==null)   this.density.bcfFish=42;// {

        this.density.cfish=this.density.PEClocalwater_ann*this.density.bcfFish;

        if(this.parameter.irFish==null) this.parameter.irFish=0.03;
        if(this.parameter.ef==null) this.parameter.ef=365;
        if(this.parameter.ed==null) this.parameter.ed=70;
        if(this.parameter.bw==null) this.parameter.bw=60.6;
        if(this.parameter.at==null) this.parameter.at=25550;
        this.form.addoralFood=((this.density.cfish/1000)*this.parameter.irFish*this.parameter.ef*this.parameter.ed)/(this.parameter.bw*this.parameter.at);

        this.form.addoralFood = this.NumberJudge(this.form.addoralFood);

      },
      compute_ADDT() {
        this.form.addt=Number((Number(this.form.addinh)+Number(this.form.addoralWater)+Number(this.form.addoralFood)).toFixed(7));
        this.form.addt=this.NumberJudge(this.form.addt);
      },
        compute_EnvirmentRcr()  {

            this.form.pecstpRcr = this.NumberJudge(this.form.pecstp/this.pecstpPnec);
            this.form.peclocalWaterRcr = this.NumberJudge(this.form.peclocalWater/this.peclocalWaterPnec);
            this.form.peclocalSedRcr = this.NumberJudge(this.form.peclocalSed/this.peclocalSedPnec);
            this.form.peclocalSoil30Rcr = this.NumberJudge(this.form.peclocalSoil30/this.peclocalSoil30Pnec);
            this.form.peclocalGrwRcr = this.NumberJudge(this.form.peclocalGrw/this.peclocalGrwPnec);
            this.form.pecaquPredatorRcr = this.NumberJudge(this.form.pecaquPredator/this.pecaquPredatorPnec);
            this.form.pecterPredatorRcr = this.NumberJudge(this.form.pecterPredator/this.pecterPredatorPnec);

        },
        compute_HealthRcr(){
            this.form.addinhRcr=this.NumberJudge(Number(this.form.addinh)/Number(this.addtDnel));
            this.form.addoralWaterRcr=this.NumberJudge(this.form.addoralWater/this.addoralWaterDnel);
            this.form.addoralFoodRcr=this.NumberJudge(this.form.addoralFood/this.addoralFoodDnel);
            this.form.addtRcr=this.NumberJudge(Number(this.form.addt)/this.addtDnel);
        },
    },
  };
</script>

<style scoped lang="scss">
  #Scenes {
    font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB,
    Microsoft YaHei, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
    color: #484a4d;
    /* background:  #b6bbbb21; */
    position: absolute;
    top: 0px;
    bottom: 0px;
    left: 0px;
    right: 0px;
  }

  .scenes-left{
    position: absolute;
    width: 13%;
    height: 10%;
    left:0;
  }

  .scenes-content{
    position:absolute;
    right:10%;
    left:17%;
    top:0%;
    bottom:10px;
  }

  .item-paifang {
    display: flex;
    justify-content: center;
    /*align-items: center;*/
    font-size: 30px;
    font-weight: bold;
  }
  .el-form-item__label{
    font-size: 18px;
    /*font-weight: bold;*/
  }

  .emission-content{
    position:absolute;
    right:10%;
    left: 17%;
    top: 0;


    .el-col{
      color: #545c64;
    };
  };
  .emission-footer{
    position:absolute;
    right: 42.5%;
    top: 100%;
  }
  .clearfix:before{

  }
  .clearfix:after {
    font-size: 30px;
    display: table;
    content: "";
  }
  .clearfix:after {
    clear: both
  }

  .box-card {
    width: 100%;

  }

  .result-content{
    top: 100%;
    right:10%;
    left: 13%;

  }

  .el-scrollbar {
    height: 100%;

    .scrollbar-wrap {
      overflow-x: hidden;
    }
    .el-scrollbar__bar{

    }
  }

</style>
